Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Kang-min Liu @gugod

Slide 3

Slide 3 text

/me @gugod, ཱུ߁ຽ, Kang-min Liu Web programmer CPAN Author for ~100 distributions http://perlbrew.pl

Slide 4

Slide 4 text

/me @gugod, ཱུ߁ຽ, Kang-min Liu { Perl, Ruby, Javascript, HTML, CSS, SQL, Photoshop } programmer CPAN Author for ~100 distributions http://perlbrew.pl

Slide 5

Slide 5 text

perlbrew

Slide 6

Slide 6 text

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

← /usr/bin/perl5.8.8 /usr/bin/perl5.10.0 /usr/bin/perl site_lib is preserved after upgrade @INC gets longer and longer.

Slide 9

Slide 9 text

The awesomeness perl is very backward compatible Ideal for production keep upgrading perl is generally OK don’t necessarily have to upgrade cpan modules following a perl upgrade.

Slide 10

Slide 10 text

The huh CPAN modules are not necessarily backward compatible. XS modules might need to be recompiled with new perl Upgrading modules might not be avoidable.

Slide 11

Slide 11 text

The hmm The current CPAN architecture sort of encourages upgrading The default is to install the latest version of modules. Upgrading CPAN modules isn’t necessarily smooth.

Slide 12

Slide 12 text

The err Errors happens at runtime XS errors happens at install / compile time and it is ^%@&* to solve.

Slide 13

Slide 13 text

Worst of all Have to upgrade perl before doing all that. an all-in-ish move

Slide 14

Slide 14 text

Worst of all Dirty state 100 CPAN modules are updated 1 failed Can’t easily revert

Slide 15

Slide 15 text

retreat cp /usr/bin/perl${old} /usr/bin/perl old perl does not contain new site_lib

Slide 16

Slide 16 text

But what if Upgrade perl for... performance bug-fixes evaluation

Slide 17

Slide 17 text

Practicals Module authors have to correctly specify module dependencies. Module users have to run tests in order to reveal runtime errors. assuming there are sufficient numbers of tests

Slide 18

Slide 18 text

!

Slide 19

Slide 19 text

perlbrew A tool to install different versions of perls

Slide 20

Slide 20 text

admin-free perl installation management

Slide 21

Slide 21 text

beer-driven software development

Slide 22

Slide 22 text

rvm 1.8, 1.9, ree, jruby, rubinus, macruby, maglev, ironruby

Slide 23

Slide 23 text

perlbrew 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15

Slide 24

Slide 24 text

Installation # 1 curl -kL http://xrl.us/perlbrewinstall | bash # 2 cpan -i App::perlbrew perlbrew init

Slide 25

Slide 25 text

Usage perlbrew install perl-5.12.2 perlbrew install perl-5.13.5 perlbrew install perl-5.10.1 perlbrew install perl-5.8.8 * Internet connection is required

Slide 26

Slide 26 text

Usage perlbrew use perl-5.14.2 perlbrew use perl-5.15.5 perlbrew switch perl-5.14.2 perlbrew off

Slide 27

Slide 27 text

Usage perlbrew list

Slide 28

Slide 28 text

> perlbrew list perl-5.10.0 perl-5.10.1 perl-5.10.1 perl-5.12.3 perl-5.14.1 * perl-5.14.2 perl-5.14.2@app-awesome perl-5.15.3

Slide 29

Slide 29 text

Usage perlbrew lib

Slide 30

Slide 30 text

Usage perlbrew lib list perlbrew lib create nobita perlbrew lib create perl-5.14.2@nobita perlbrew use perl-5.14.2@nobita perlbrew lib delete perl-5.12.3@nobita

Slide 31

Slide 31 text

cd ~/src/App-Awesome perlbrew use perl-5.10.1@app-awesome perlbrew use perl-5.14.2@app-awesome cd ~/src/Module-Awesome perlbrew use perl-5.10.1@nobita perlbrew use perl-5.14.1@nobita perlbrew use perl-5.14.2@nobita

Slide 32

Slide 32 text

perlbrew use perl-5.10.1@app-awesome

Slide 33

Slide 33 text

perlbrew use perl-5.10.1@app-awesome perl installation name

Slide 34

Slide 34 text

perlbrew use perl-5.10.1@app-awesome local::lib name

Slide 35

Slide 35 text

perlbrew use perl-5.10.1@app-awesome

Slide 36

Slide 36 text

eval `perl -Mlocal::lib=~/.perlbrew/ libs/perl-5.10.1@app-awesome/`

Slide 37

Slide 37 text

% perl -V ... Compiled at Sep 27 2011 14:08:36 %ENV: PERL5LIB="/Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome/lib/perl5/darwin-2level:/ Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome/lib/perl5" PERLBREW_BASHRC_VERSION="0.30," PERLBREW_HOME="/Users/gugod/.perlbrew" PERLBREW_LIB="app-awesome" PERLBREW_PATH="/Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome/bin:/Users/gugod/ perl5/perlbrew/bin:/Users/gugod/perl5/perlbrew/perls/perl-5.14.2/bin" PERLBREW_PERL="perl-5.14.2" PERLBREW_ROOT="/Users/gugod/perl5/perlbrew" PERLBREW_VERSION="0.30" PERL_LOCAL_LIB_ROOT="/Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome" PERL_MB_OPT="--install_base /Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome" PERL_MM_OPT="INSTALL_BASE=/Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome" @INC: /Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome/lib/perl5/darwin-2level /Users/gugod/.perlbrew/libs/perl-5.14.2@app-awesome/lib/perl5 /Users/gugod/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/darwin-2level /Users/gugod/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2 /Users/gugod/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/darwin-2level /Users/gugod/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2

Slide 38

Slide 38 text

perlbrew.pl 0.30

Slide 39

Slide 39 text

Properties isolated perl installations bin, site_lib, local::lib install a new version ≠ upgrade @INC does not include old site_lib

Slide 40

Slide 40 text

Benefits `sudo cpan` is no more easier-to-clean perl environments Nuke the whole thing to clean the mess No old @INC

Slide 41

Slide 41 text

Benefits per-app isolated perl environments setup. avoid, in advance, any possible incompatible issues with other apps. know your libs

Slide 42

Slide 42 text

avoid lib conflicts with what you had install older versions of modules without worries to break other app code. cpanm http://URL.TO/Mo-0.1.tar.gz App::pmuninstall Benefits

Slide 43

Slide 43 text

Rationale Don’t mess up vendor perl too much. Learn new stuffs in the dev version of perl. keep up with the fashion

Slide 44

Slide 44 text

Rationale Test modules or apps ... with newer perl ... with older perl

Slide 45

Slide 45 text

Rationale Test perl itself -Dusethreads -Duse64bitall -Duse64bitint Configure -h -D -U -A

Slide 46

Slide 46 text

Rationale spare some guts B, XS Better with a perl built with DEBUGGING

Slide 47

Slide 47 text

Thoughts perlbrew « cpanm, ack, rvm

Slide 48

Slide 48 text

Thoughts One standalone program embed non-core modules very easy distribution runs a tiny bit faster

Slide 49

Slide 49 text

Thoughts rvm bash programming master-piece developer-friendly experiences production uses

Slide 50

Slide 50 text

Further Thoughts Deprecate switch/use to external perl Improve multi-user scenario More related tool to help developer identify module upgrade failure, and revert to a good state.

Slide 51

Slide 51 text

Further Thoughts Good + Simple toolkit Keep new-comers by not frustrating them Grow the community

Slide 52

Slide 52 text

Simple is Hard

Slide 53

Slide 53 text

Development http://github.com/gugod/App-perlbrew 49 contributors Feedback github issue / pull requests rt.cpan.org #perlbrew on twitter

Slide 54

Slide 54 text

Development http://perlbrew.pl Documentation / Updates A static version of github Wiki

Slide 55

Slide 55 text

Thank You