Contenu connexe Similaire à CPAN 模組二三事 (20) CPAN 模組二三事1. CPAN
c9s (cornelius)
http://github.com/c9s
cornelius.howl@gmail.com
3. • DRY ( Dont repeat yourself)
• Class Library
• 3400+ authors
• 12000+ modules
• Unit Tests
10. Read-only Module ?
Patch Please patch locally.... XD
25. • audreyt (autrijus) CPAN Module
• gugod Authors
• clkao in Taiwan
• clsung
Acme::CPANAuthors::Taiwanese
• imacat
• shelling
• BlueT
• cornelius (c9s)
• etc...
26. • ADAMK (218+ )
• RJBS (211+ )
• Miyagawa ( 177+ )
• CPAN Leaderboard
http://thegestalt.org/simon/perl/wholecpan.html
28. • $ wget http://path/to/Dist-{version}.tar.gz
• $ perl Makefile.PL # Makefile
• $ make
• $ make install
30. CPAN Shell
• Unix-like platform
•
• : $ cpan [Module Name]
38. CPANMinus
from github
$ git clone git://github.com/miyagawa/cpanminus.git
$ cd cpanminus
$ perl Makefile.PL
$ make install
46. • Perldoc :
$ perldoc Data::Dumper
• search.cpan.org
• Synopsis
• Code use :
use Data::Dumper;
49. 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};
51. 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 )
58. Documents
• Office
• Spreadsheet::WriteExcel,
Spreadsheet::ParseExcel ...
• OpenOffice::*
• PDF::API2
60. Network
• Protocols
• Net::FTP , Net::SSH, Net::SCP, Net::DNS,
• Net::DHCP , Net::Ping ....
• Low level
• IO::Socket, Net::Packet, Net::Pcap ...
61. Database
• DBI (PostgreSQL, SQLite, Oracle, MySQL ...)
• DBI::Proxy, DBD::Gofer
• DBIx::Simple
63. Tests
• Test::More,
Test::BuilderDevel::CoverTest::Deep,
Test::LongStringTest::Exception,
Test::NoWarningsTest::MockModule,
Test::MockObjectTest::Class,
Test::UnitTest::LectroTest
68. The External World
• Languages
• Inline: C , Java, Ruby, Python ...
• External Library
• XS
• Devel::PPPort
• Swig
• etc...
70. • The Phalanx 100: http://qa.perl.org/
phalanx/100/
• CPAN Search: http://search.cpan.org/
• Perldoc: http://www.perldoc.org
• Perl Cookbook
74. • Module::Starter
$ module-starter --mi --module=Foo::Bar
--author=”Your Name” --email=your_email@blah.com
• lib/Foo/Bar.pm
• t/*.t
• Makefile.PL
75. • 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