←
/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
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
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