0
Perl

       Kang-min Liu
         @gugod
.meta

• twitter.com/gugod
• Perl / Javascript / Ruby programmer
• CPAN Author for ~100 distributions
• perlbrew
perlbrew
perlbrew

• A tool to install tons of perls
 • switch between them
 • build with customized options
   (-D -A -U)

 • buil...
Usage

perlbrew install perl-5.12.2
perlbrew install perl-5.13.5




      * Internet connection is required
Usage

perlbrew install perl-5.10.1
perlbrew install perl-5.8.8




      * Internet connection is required
Usage

# git checkout
cd ~/src/perl
perlbrew install .




* Internet connection is not required
Usage

perlbrew installed
> perlbrew installed
perl-5.10.0
perl-5.10.1
perl-5.11.1
perl-5.11.5
perl-5.12.0
perl-5.12.0-RC0
perl-5.12.0-RC3
perl-5.12...
Usage

perlbrew switch perl-5.12.2

# Disable perlbrew
perlbrew off
Installation

curl −LO http://xrl.us/perlbrew
chmod +x perlbrew
./perlbrew install
Installation
                                  new




curl -L http://xrl.us/perlbrewinstall | bash
Installation

cpan -i App::perlbrew




    * Not recommended
Properties

• does not require sudo
• perl installation are isolated
 • site_lib, bin, lib
• install a new version ≠ upgra...
Benefits

• Easier-to-clean perl environments
 • Nuke the whole thing to clean the
   mess

• Old @INC does not accumulate ...
Benefits
• per-app isolated perl environments
  setup.

 • avoid, in advance, any possible
   incompatible issues with othe...
Why?

• Don’t mess up vendor perl too
  much.

• Learn new stuffs in the dev version
  of perl.

 • keep up with the fashi...
Why?

• Test modules or apps
 • ... with newer perl
 • ... with older perl
Why?

• Test perl itself
 • Threaded perl
 • 64bit perl
 • performance
• smokebrew
Why?

• Play dark magic kitchen fire
 • Devel::Declare, B::*, XS
 • Better with a perl built with
    DEBUGING
development

• github.com/gugod/App-perlbrew
• so many pull requests
• 20 contributors
• send me pull requests any time!
development

• better bash integration /
  experiments

• easy site_lib management (clone /
  bundle / nuke)

• Steal some...
←
← perlbrew

• /usr/local/bin/perl
  /opt/local/bin/perl
  /home/gugod/local/bin/perl

• site_lib is preserved after upgrade
← perlbrew

• perl is so backward compatible
• Ideal for developing and production
• keep upgrading perl is generally OK
← perlbrew

• Upgrading CPAN modules isn’t
  necessarily OK.

• Errors happens at runtime, when it’s
  not binary-compatib...
← perlbrew


• In CPAN Distribution you do that in
  Makefile.PL / META.yml

• Same tool for App
Simple is Hard

• support for legacy code and
  decisions.

• perl, cpan
• cpanm, perlbrew: new tools for the
  current fa...
Thoughts

perlbrew « cpanm, rvm
Thoughts

• Standalone program
 • embed non-core modules
 • very easy distribution
 • runs a tiny bit faster
Thoughts

• « rvm
 • bash programming master-piece
 • developer-friendly experiences
 • production server
Further Thoughts
• Test::Continuous
• perlbrew
• local::lib
• App::local::lib::helper
• cpanm
• cpan-outdated
• cpansearch
rapidly improves something
a little bit better
rapidly improves something
a little bit better ❤
Hates
Hates
• CPAN dependency list for
  $framework is too long

• CPAN $modules takes too long to
  install / tests takes very ...
Less Hateful

• bundle cpan dists with your
  distribution

• PAR / Shipwright / %INC hack
• Avoid long dependency list
Less Hateful
• smaller, single-purpose
• less memory consumption
• less sub-commands to be
  memorized

 • less memory con...
cpan install can run 90% faster...
By skiping all tests,
cpan install can run 90% faster...
Less Hateful

• To skip for tests safely, consult
  cpantester.org first

• A cpan/cpanm plugin shall be
  written to autom...
Less Hateful

• Solving long dependency list
  problem is a no-op

 • if cpan installation is super fast
 • like < 1 secon...
Fast fists cannot be broken
side projects
cpan-sets

• cpan-sets: local::lib switcher wrote in
 • « rvm gemset, bundler
 • App::local::lib::helper
 • experimental p...
cpanfile
# Install with: cpanm < cpanfile
http://github.com/bestpractical/jifty-dbi/tarball/master
http://github.com/bestpr...
perlrocks
• rubygems counter-part.
• multi-version module     install

• use perlrocks;
  # perl5 syntax of ‘use’
  use Fo...
side projects

• github.com/gugod/App-perlbrew
• github.com/gugod/cpan-sets
• github.com/gugod/perlrocks
Conclusion

• github social coding actually works!
• Easy distributing is important.
• Simple is hard.
• Fast is better th...
∞

• Good + Simple + Easy toolkit
• Keep new-comers by not frustrating
  them

• Grow the community
Thank You
perlbrew yapcasia 2010
perlbrew yapcasia 2010
Upcoming SlideShare
Loading in...5
×

perlbrew yapcasia 2010

2,431

Published on

This is my perlbrew talk slide for YAPC Asia 2010.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,431
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "perlbrew yapcasia 2010"

  1. 1. Perl Kang-min Liu @gugod
  2. 2. .meta • twitter.com/gugod • Perl / Javascript / Ruby programmer • CPAN Author for ~100 distributions • perlbrew
  3. 3. perlbrew
  4. 4. perlbrew • A tool to install tons of perls • switch between them • build with customized options (-D -A -U) • build from tarball or git
  5. 5. Usage perlbrew install perl-5.12.2 perlbrew install perl-5.13.5 * Internet connection is required
  6. 6. Usage perlbrew install perl-5.10.1 perlbrew install perl-5.8.8 * Internet connection is required
  7. 7. Usage # git checkout cd ~/src/perl perlbrew install . * Internet connection is not required
  8. 8. Usage perlbrew installed
  9. 9. > perlbrew installed perl-5.10.0 perl-5.10.1 perl-5.11.1 perl-5.11.5 perl-5.12.0 perl-5.12.0-RC0 perl-5.12.0-RC3 perl-5.12.1 perl-5.12.2(*) perl-5.13.0 perl-5.13.2 perl-5.13.4 perl-v5.11.5-15-gd3b0eb1 /Users/gugod/perl5/perlbrew/bin/perl /Users/gugod/perl5/perlbrew/perls/current/ bin/perl /usr/bin/perl
  10. 10. Usage perlbrew switch perl-5.12.2 # Disable perlbrew perlbrew off
  11. 11. Installation curl −LO http://xrl.us/perlbrew chmod +x perlbrew ./perlbrew install
  12. 12. Installation new curl -L http://xrl.us/perlbrewinstall | bash
  13. 13. Installation cpan -i App::perlbrew * Not recommended
  14. 14. Properties • does not require sudo • perl installation are isolated • site_lib, bin, lib • install a new version ≠ upgrade • @INC does not include old site_lib
  15. 15. Benefits • Easier-to-clean perl environments • Nuke the whole thing to clean the mess • Old @INC does not accumulate with old perls
  16. 16. Benefits • per-app isolated perl environments setup. • avoid, in advance, any possible incompatible issues with other apps. • know your site_libs • ‘sudo cpan’ is no more.
  17. 17. Why? • Don’t mess up vendor perl too much. • Learn new stuffs in the dev version of perl. • keep up with the fashion
  18. 18. Why? • Test modules or apps • ... with newer perl • ... with older perl
  19. 19. Why? • Test perl itself • Threaded perl • 64bit perl • performance • smokebrew
  20. 20. Why? • Play dark magic kitchen fire • Devel::Declare, B::*, XS • Better with a perl built with DEBUGING
  21. 21. development • github.com/gugod/App-perlbrew • so many pull requests • 20 contributors • send me pull requests any time!
  22. 22. development • better bash integration / experiments • easy site_lib management (clone / bundle / nuke) • Steal some goodies from Devel::PPPort
  23. 23.
  24. 24. ← perlbrew • /usr/local/bin/perl /opt/local/bin/perl /home/gugod/local/bin/perl • site_lib is preserved after upgrade
  25. 25. ← perlbrew • perl is so backward compatible • Ideal for developing and production • keep upgrading perl is generally OK
  26. 26. ← perlbrew • Upgrading CPAN modules isn’t necessarily OK. • Errors happens at runtime, when it’s not binary-compatible. • Developers must correctly specify module dependencies.
  27. 27. ← perlbrew • In CPAN Distribution you do that in Makefile.PL / META.yml • Same tool for App
  28. 28. Simple is Hard • support for legacy code and decisions. • perl, cpan • cpanm, perlbrew: new tools for the current fashion
  29. 29. Thoughts perlbrew « cpanm, rvm
  30. 30. Thoughts • Standalone program • embed non-core modules • very easy distribution • runs a tiny bit faster
  31. 31. Thoughts • « rvm • bash programming master-piece • developer-friendly experiences • production server
  32. 32. Further Thoughts • Test::Continuous • perlbrew • local::lib • App::local::lib::helper • cpanm • cpan-outdated • cpansearch
  33. 33. rapidly improves something a little bit better
  34. 34. rapidly improves something a little bit better ❤
  35. 35. Hates
  36. 36. Hates • CPAN dependency list for $framework is too long • CPAN $modules takes too long to install / tests takes very long time to finish • $software is too fat (eats too much memory space) and slow
  37. 37. Less Hateful • bundle cpan dists with your distribution • PAR / Shipwright / %INC hack • Avoid long dependency list
  38. 38. Less Hateful • smaller, single-purpose • less memory consumption • less sub-commands to be memorized • less memory consumption in your brain • easier to maintain / be faster
  39. 39. cpan install can run 90% faster...
  40. 40. By skiping all tests, cpan install can run 90% faster...
  41. 41. Less Hateful • To skip for tests safely, consult cpantester.org first • A cpan/cpanm plugin shall be written to automates that.
  42. 42. Less Hateful • Solving long dependency list problem is a no-op • if cpan installation is super fast • like < 1 second / module
  43. 43. Fast fists cannot be broken
  44. 44. side projects
  45. 45. cpan-sets • cpan-sets: local::lib switcher wrote in • « rvm gemset, bundler • App::local::lib::helper • experimental project • per-app bundle
  46. 46. cpanfile # Install with: cpanm < cpanfile http://github.com/bestpractical/jifty-dbi/tarball/master http://github.com/bestpractical/jifty/tarball/master http://github.com/bestpractical/jifty-plugin-openid B::Hooks::EndOfScope DateTime Digest::SHA1 Email::Address Exporter::Lite HTML::Entities JiftyX::Markapl JiftyX::ModelHelpers Markapl Regexp::Common Regexp::Common::Email::Address String::BufferStack Sub::Install Text::Markdown::Discount Text::MultiMarkdown UNIVERSAL::require common::sense
  47. 47. perlrocks • rubygems counter-part. • multi-version module install • use perlrocks; # perl5 syntax of ‘use’ use Foo-1.3; • site_lib/rocks/Foo-1.3/lib/Foo.pm • Installation tool (rock)
  48. 48. side projects • github.com/gugod/App-perlbrew • github.com/gugod/cpan-sets • github.com/gugod/perlrocks
  49. 49. Conclusion • github social coding actually works! • Easy distributing is important. • Simple is hard. • Fast is better then slow.
  50. 50. ∞ • Good + Simple + Easy toolkit • Keep new-comers by not frustrating them • Grow the community
  51. 51. Thank You
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×