CPAN
        c9s (cornelius)
     http://github.com/c9s
  cornelius.howl@gmail.com
CPAN
• DRY ( Dont repeat yourself)
• Class Library
• 3400+ authors
• 12000+ modules
• Unit Tests
CPAN
CPAN   ?
Release Often
Unit Testing
Module review
Write Once
Never Maintain (?)
             XD
Read-only           Module ?
 Patch   Please patch locally.... XD
(   )
XD
.... (blush)
CPAN
CPAN Module
•   audreyt (autrijus)      CPAN Module
•   gugod                     Authors
•   clkao                     in Taiwan
•   clsung
                         Acme::CPANAuthors::Taiwanese
•   imacat

•   shelling

•   BlueT

•   cornelius (c9s)

•   etc...
• ADAMK (218+ )
• RJBS (211+ )
• Miyagawa ( 177+          )

• CPAN Leaderboard
     http://thegestalt.org/simon/perl/wholecpan.html
• $ wget http://path/to/Dist-{version}.tar.gz
• $ perl Makefile.PL # Makefile
• $ make
• $ make install
CPAN

• CPAN Shell
• CPANPLUS Shell
• cpanminus
        http://github.com/miyagawa/cpanminus
CPAN Shell

•   Unix-like platform

•
•   : $ cpan [Module Name]
CPANPLUS


•   CPAN Shell
CPANPLUS


•   CPAN Shell

•   CPAN Shell   XD
CPANPLUS

•   CPAN Shell

•   CPAN Shell   XD

•
cpanminus

•
•
•
•        (      )
cpanminus
http://github.com/miyagawa/cpanminus
CPANMinus

$ cd ~/bin/
$ wget http://xrl.us/cpanm
$ chmod +x cpanm
CPANMinus
           from github
$ git clone git://github.com/miyagawa/cpanminus.git
$ cd cpanminus
$ perl Makefile.PL
$ make install
$ cpanm [Module Name]
$ cpanm -n [Module Name]
                {no test}
$ cpanm -v [Module Name]
                {verbose}
$ cpanm -f [Module Name]
                {force}
$ cpanm --help
            {help}
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 .
•     Perldoc                :

    $ perldoc Data::Dumper
•     search.cpan.org

•   Synopsis

•   Code       use       :
     use Data::Dumper;
Shell


• Getopt::Long   -           Command Line


• $ getopt.pl --take=blah --id=10 --verbose -t
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};
Process

• Proc::Daemon
• ForkManager
• IPC::Run
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 )
Event


• AnyEvent::*
• POE::*
Serialization

• Data::Dumper
• Storable
• JSON (JSON::PP, JSON::XS ...)
• YAML (YAML::XS,YAML::Syck)
Web (server-side)

• AnyEvent::HTTPD
• Plack
• Catalyst , Jifty , Mojo
• Template::Declare , Template::Markpl
• Mason
Web (client-side)

• LWP::UserAgent
• LWP::Simple
• AnyEvent::HTTP
• LWP::Parallel
• HTTP::Async
Web (client-side)

• Web::Scraper
• pQuery
• WWW::Mechanize
• HTTP::Async
HTML

• HTML::Parser
• HTTP::TreeBuilder
• WebService::Validator::HTML::W3C
Documents

• Office
 • Spreadsheet::WriteExcel,
    Spreadsheet::ParseExcel ...
 • OpenOffice::*
 • PDF::API2
Graphics
• GD, Imager
• Image::Magick
• Gimp
                   • SVG::Graph
• Cairo
• GraphViz
• Image::LibRSVG
Network

• Protocols
 • Net::FTP , Net::SSH, Net::SCP, Net::DNS,
 • Net::DHCP , Net::Ping ....
• Low level
 • IO::Socket, Net::Packet, Net::Pcap ...
Database


•   DBI (PostgreSQL, SQLite, Oracle, MySQL ...)

•   DBI::Proxy, DBD::Gofer

•   DBIx::Simple
ORM
• Class::DBI, DBIx::Class
•   Jifty::DBI

•   Prophet

• Tangram, Alzabo, SPOPS
• Rose::DB::Object, DBIx::DataModel,
    Fey::ORM
Tests

• Test::More,
  Test::BuilderDevel::CoverTest::Deep,
  Test::LongStringTest::Exception,
  Test::NoWarningsTest::MockModule,
  Test::MockObjectTest::Class,
  Test::UnitTest::LectroTest
• Module::Starter
• App::Ack
• Perl::Tidy
• Perl::Tags
Debugging

• XXX
• Devel::SimpleTrace
• Devel::Graph
• Devel::LeakTrace
• Devel::NYTProf
Cache

• Cache::CHI
• Cache::Memory
• Cache::File
• Cache::Memcached
•
Object-oriented
      Programming
• Class::MOP
• Moose
• Mouse
• autobox
The External World
•   Languages

    •   Inline: C , Java, Ruby, Python ...

•   External Library

    •   XS

    •   Devel::PPPort

    •   Swig

    •   etc...
• Git
• Github::Import
• Gearman
• ....
• The Phalanx 100: http://qa.perl.org/
  phalanx/100/
• CPAN Search: http://search.cpan.org/
• Perldoc: http://www.perldoc.org
• Perl Cookbook
Perlbuzz.com
• Module::Starter
    $ module-starter --mi --module=Foo::Bar 
         --author=”Your Name” --email=your_email@blah.com


•                lib/Foo/Bar.pm

•                t/*.t

•         Makefile.PL
•    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
...
Live Demo   XD
Thanks
 /c9s/

CPAN 模組二三事