SlideShare une entreprise Scribd logo
1  sur  79
Télécharger pour lire hors ligne
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/

Contenu connexe

Tendances

Владимир Перепелица "Модули"
Владимир Перепелица "Модули"Владимир Перепелица "Модули"
Владимир Перепелица "Модули"
Media Gorod
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
Cloudflare
 

Tendances (20)

Hashiconf EU 2019 - A Tour of Terraform 0.12
Hashiconf EU 2019 - A Tour of Terraform 0.12Hashiconf EU 2019 - A Tour of Terraform 0.12
Hashiconf EU 2019 - A Tour of Terraform 0.12
 
Workshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - SuestraWorkshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - Suestra
 
Everything as Code with Terraform
Everything as Code with TerraformEverything as Code with Terraform
Everything as Code with Terraform
 
Perl Memory Use 201209
Perl Memory Use 201209Perl Memory Use 201209
Perl Memory Use 201209
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Владимир Перепелица "Модули"
Владимир Перепелица "Модули"Владимир Перепелица "Модули"
Владимир Перепелица "Модули"
 
Terraform 0.9 + good practices
Terraform 0.9 + good practicesTerraform 0.9 + good practices
Terraform 0.9 + good practices
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
Mасштабирование микросервисов на Go, Matt Heath (Hailo)Mасштабирование микросервисов на Go, Matt Heath (Hailo)
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
 
High Performance tDiary
High Performance tDiaryHigh Performance tDiary
High Performance tDiary
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Infrastructure as Code in Google Cloud
Infrastructure as Code in Google CloudInfrastructure as Code in Google Cloud
Infrastructure as Code in Google Cloud
 
Ansible
AnsibleAnsible
Ansible
 
Infrastructure as Code: Introduction to Terraform
Infrastructure as Code: Introduction to TerraformInfrastructure as Code: Introduction to Terraform
Infrastructure as Code: Introduction to Terraform
 
Top 10 Perl Performance Tips
Top 10 Perl Performance TipsTop 10 Perl Performance Tips
Top 10 Perl Performance Tips
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
 
Triple Blitz Strike
Triple Blitz StrikeTriple Blitz Strike
Triple Blitz Strike
 
并发模型介绍
并发模型介绍并发模型介绍
并发模型介绍
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby Core
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
 

En vedette (6)

I18n with PHP 5.3
I18n with PHP 5.3I18n with PHP 5.3
I18n with PHP 5.3
 
Zend Core on IBM i - Security Considerations
Zend Core on IBM i - Security ConsiderationsZend Core on IBM i - Security Considerations
Zend Core on IBM i - Security Considerations
 
PHP on Windows - What's New
PHP on Windows - What's NewPHP on Windows - What's New
PHP on Windows - What's New
 
Zend_Tool: Practical use and Extending
Zend_Tool: Practical use and ExtendingZend_Tool: Practical use and Extending
Zend_Tool: Practical use and Extending
 
PHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudPHP and Platform Independance in the Cloud
PHP and Platform Independance in the Cloud
 
Framework Shootout
Framework ShootoutFramework Shootout
Framework Shootout
 

Similaire à CPAN 模組二三事

Ruby v cpp_preso
Ruby v cpp_presoRuby v cpp_preso
Ruby v cpp_preso
jessicard
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
LeanDog
 

Similaire à CPAN 模組二三事 (20)

Agiles Peru 2019 - Infrastructure As Code
Agiles Peru 2019 - Infrastructure As CodeAgiles Peru 2019 - Infrastructure As Code
Agiles Peru 2019 - Infrastructure As Code
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"
CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"
CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Ruby v cpp_preso
Ruby v cpp_presoRuby v cpp_preso
Ruby v cpp_preso
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd についてKubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
 
Node.js/io.js Native C++ Addons
Node.js/io.js Native C++ AddonsNode.js/io.js Native C++ Addons
Node.js/io.js Native C++ Addons
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
Don’t turn your logs into cuneiform
Don’t turn your logs into cuneiformDon’t turn your logs into cuneiform
Don’t turn your logs into cuneiform
 
OSインストーラーの自作方法
OSインストーラーの自作方法OSインストーラーの自作方法
OSインストーラーの自作方法
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projects
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk
 
Simon Bennetts - Automating ZAP
Simon Bennetts - Automating ZAP Simon Bennetts - Automating ZAP
Simon Bennetts - Automating ZAP
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
 
Can puppet help you run docker on a T2.Micro?
Can puppet help you run docker on a T2.Micro?Can puppet help you run docker on a T2.Micro?
Can puppet help you run docker on a T2.Micro?
 

Plus de Lin Yo-An (13)

Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 
Getting merged
Getting mergedGetting merged
Getting merged
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP haters
 
OSDC.TW 2014 building popular open source projects
OSDC.TW 2014   building popular open source projectsOSDC.TW 2014   building popular open source projects
OSDC.TW 2014 building popular open source projects
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
 
Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1
 
Secret sauce of building php applications
Secret sauce of building php applicationsSecret sauce of building php applications
Secret sauce of building php applications
 
LazyRecord: The Fast ORM for PHP
LazyRecord: The Fast ORM for PHPLazyRecord: The Fast ORM for PHP
LazyRecord: The Fast ORM for PHP
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script Programming
 
Vim Hacks (OSSF)
Vim Hacks (OSSF)Vim Hacks (OSSF)
Vim Hacks (OSSF)
 
Perl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaPerl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim Perlchina
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 

CPAN 模組二三事