Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

perlbrew yapcasia 2010

3,089 views

Published on

This is my perlbrew talk slide for YAPC Asia 2010.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

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

×