Your SlideShare is downloading. ×
CPAN 模組二三事
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

CPAN 模組二三事

4,062
views

Published on

CPAN 模組

CPAN 模組


0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,062
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
18
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CPAN c9s (cornelius) http://github.com/c9s cornelius.howl@gmail.com
  • 2. CPAN
  • 3. • DRY ( Dont repeat yourself) • Class Library • 3400+ authors • 12000+ modules • Unit Tests
  • 4. CPAN
  • 5. CPAN ?
  • 6. Release Often
  • 7. Unit Testing
  • 8. Module review
  • 9. Write Once Never Maintain (?) XD
  • 10. Read-only Module ? Patch Please patch locally.... XD
  • 11. ( )
  • 12. XD
  • 13. .... (blush)
  • 14. CPAN
  • 15. CPAN Module
  • 16. • audreyt (autrijus) CPAN Module • gugod Authors • clkao in Taiwan • clsung Acme::CPANAuthors::Taiwanese • imacat • shelling • BlueT • cornelius (c9s) • etc...
  • 17. • ADAMK (218+ ) • RJBS (211+ ) • Miyagawa ( 177+ ) • CPAN Leaderboard http://thegestalt.org/simon/perl/wholecpan.html
  • 18. • $ wget http://path/to/Dist-{version}.tar.gz • $ perl Makefile.PL # Makefile • $ make • $ make install
  • 19. CPAN • CPAN Shell • CPANPLUS Shell • cpanminus http://github.com/miyagawa/cpanminus
  • 20. CPAN Shell • Unix-like platform • • : $ cpan [Module Name]
  • 21. CPANPLUS • CPAN Shell
  • 22. CPANPLUS • CPAN Shell • CPAN Shell XD
  • 23. CPANPLUS • CPAN Shell • CPAN Shell XD •
  • 24. cpanminus • • • • ( )
  • 25. cpanminus http://github.com/miyagawa/cpanminus
  • 26. CPANMinus $ cd ~/bin/ $ wget http://xrl.us/cpanm $ chmod +x cpanm
  • 27. CPANMinus from github $ git clone git://github.com/miyagawa/cpanminus.git $ cd cpanminus $ perl Makefile.PL $ make install
  • 28. $ cpanm [Module Name]
  • 29. $ cpanm -n [Module Name] {no test}
  • 30. $ cpanm -v [Module Name] {verbose}
  • 31. $ cpanm -f [Module Name] {force}
  • 32. $ cpanm --help {help}
  • 33. cpanm CGI cpanm MIYAGAWA/Plack-0.99_05.tar.gz cpanm http://example.org/LDS/CGI.pm-3.20.tar.gz cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz cpanm --interactive Task::Kensho cpanm . cpanm --installdeps .
  • 34. • Perldoc : $ perldoc Data::Dumper • search.cpan.org • Synopsis • Code use : use Data::Dumper;
  • 35. Shell • Getopt::Long - Command Line • $ getopt.pl --take=blah --id=10 --verbose -t
  • 36. Shell • Pod::Usage - my %options = ( debug => 0, ); GetOptions(%options, qw{ help|h! version|V! debug|d! config|c=s }) or pod2usage(0); pod2usage({ -verbose => 2, -exitval => 0, -noperldoc => 1 }) if $options{help};
  • 37. Process • Proc::Daemon • ForkManager • IPC::Run
  • 38. Lists • List::Util maxstr min minstr reduce shuffle sum ) ( first max • List::MoreUtils ( any all none notall true false firstidx first_index lastidx last_index insert_after insert_after_string apply after after_incl before before_incl indexes firstval first_value lastval last_value each_array each_arrayref pairwise natatime mesh zip uniq minmax )
  • 39. Event • AnyEvent::* • POE::*
  • 40. Serialization • Data::Dumper • Storable • JSON (JSON::PP, JSON::XS ...) • YAML (YAML::XS,YAML::Syck)
  • 41. Web (server-side) • AnyEvent::HTTPD • Plack • Catalyst , Jifty , Mojo • Template::Declare , Template::Markpl • Mason
  • 42. Web (client-side) • LWP::UserAgent • LWP::Simple • AnyEvent::HTTP • LWP::Parallel • HTTP::Async
  • 43. Web (client-side) • Web::Scraper • pQuery • WWW::Mechanize • HTTP::Async
  • 44. HTML • HTML::Parser • HTTP::TreeBuilder • WebService::Validator::HTML::W3C
  • 45. Documents • Office • Spreadsheet::WriteExcel, Spreadsheet::ParseExcel ... • OpenOffice::* • PDF::API2
  • 46. Graphics • GD, Imager • Image::Magick • Gimp • SVG::Graph • Cairo • GraphViz • Image::LibRSVG
  • 47. Network • Protocols • Net::FTP , Net::SSH, Net::SCP, Net::DNS, • Net::DHCP , Net::Ping .... • Low level • IO::Socket, Net::Packet, Net::Pcap ...
  • 48. Database • DBI (PostgreSQL, SQLite, Oracle, MySQL ...) • DBI::Proxy, DBD::Gofer • DBIx::Simple
  • 49. ORM • Class::DBI, DBIx::Class • Jifty::DBI • Prophet • Tangram, Alzabo, SPOPS • Rose::DB::Object, DBIx::DataModel, Fey::ORM
  • 50. Tests • Test::More, Test::BuilderDevel::CoverTest::Deep, Test::LongStringTest::Exception, Test::NoWarningsTest::MockModule, Test::MockObjectTest::Class, Test::UnitTest::LectroTest
  • 51. • Module::Starter • App::Ack • Perl::Tidy • Perl::Tags
  • 52. Debugging • XXX • Devel::SimpleTrace • Devel::Graph • Devel::LeakTrace • Devel::NYTProf
  • 53. Cache • Cache::CHI • Cache::Memory • Cache::File • Cache::Memcached •
  • 54. Object-oriented Programming • Class::MOP • Moose • Mouse • autobox
  • 55. The External World • Languages • Inline: C , Java, Ruby, Python ... • External Library • XS • Devel::PPPort • Swig • etc...
  • 56. • Git • Github::Import • Gearman • ....
  • 57. • The Phalanx 100: http://qa.perl.org/ phalanx/100/ • CPAN Search: http://search.cpan.org/ • Perldoc: http://www.perldoc.org • Perl Cookbook
  • 58. Perlbuzz.com
  • 59. • Module::Starter $ module-starter --mi --module=Foo::Bar --author=”Your Name” --email=your_email@blah.com • lib/Foo/Bar.pm • t/*.t • Makefile.PL
  • 60. • Makefile , , : $ perl Makefile.PL $ make test $ make dist • PAUSE ID ( http://pause.perl.org): • (CPAN::Uploader) $ make upload ... or $ cpan-upload Dist-0.01.tar.gz
  • 61. ...
  • 62. Live Demo XD
  • 63. Thanks /c9s/