Perlbrew
Upcoming SlideShare
Loading in...5
×
 

Perlbrew

on

  • 1,472 views

 

Statistics

Views

Total Views
1,472
Views on SlideShare
1,421
Embed Views
51

Actions

Likes
1
Downloads
6
Comments
0

4 Embeds 51

http://smonff.github.io 22
http://coderwall.com 17
http://mani 11
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • I started writing perlbrew in Feburary, this year, and it have became a lovely tool for hackers.\n
  • I started writing perlbrew in Feburary, this year, and it have became a lovely tool for hackers.\n
  • \n
  • \n
  • Besides vendor perl, when one manually (or done with some port system) build perl, it’s usually /usr/local or /opt/local. I build it in with $HOME/local because I don’t like to do type `sudo`.\n\nI ended up using all of above and upgrading perl become such a dangerous move. Especially when you need to re-compile several binary / XS modules.\n\nThe problem is: you simply forgot what to re-complie!\n
  • Besides vendor perl, when one manually (or done with some port system) build perl, it’s usually /usr/local or /opt/local. I build it in with $HOME/local because I don’t like to do type `sudo`.\n\nI ended up using all of above and upgrading perl become such a dangerous move. Especially when you need to re-compile several binary / XS modules.\n\nThe problem is: you simply forgot what to re-complie!\n
  • The perl interpreter is like the most backward program ever. It deprecates no inputs, and produce very consistent result.\n
  • \n
  • Modules tend to be re-write with XS / C for speed improvement. Sometimes the binary is’nt compatible to the old versions. IMHO this basically conflict with site_lib-preserving upgrade policy.\n\nIt does’n always happened, but when it happens, you see errors at runtime. Which makes you anxious: Is there anymore of these sort of errors?\n\n
  • Modules tend to be re-write with XS / C for speed improvement. Sometimes the binary is’nt compatible to the old versions. IMHO this basically conflict with site_lib-preserving upgrade policy.\n\nIt does’n always happened, but when it happens, you see errors at runtime. Which makes you anxious: Is there anymore of these sort of errors?\n\n
  • \n
  • \n
  • \n
  • \n
  • Modules tend to be re-write with XS / C for speed improvement. Sometimes the binary is’nt compatible to the old versions. IMHO this basically conflict with site_lib-preserving upgrade policy.\n\nIt does’n always happened, but when it happens, you see errors at runtime. Which makes you anxious: Is there anymore of these sort of errors?\n\n
  • \n
  • It’s basically designed for single-user, developing purposes.\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • If your CPAN installation somehow get messed up too much, you can always nuke the whole thing to star over.\n\nUpgrading /usr/local/bin/perl to a new version will put keep old site_lib dirs alone with the new site_lib dirs in the @INC. This causes problems particularly on binary modules.\n
  • \n
  • \n
  • \n
  • TEST. OF COURSE. Perl Community really loves to talk about testing. And they hate it sometimes.Just have a more precise idea how your piece of software work with different versions of perl.\n
  • perl interpreter itself must be configured with different compiling arguments to fit certain purses.\n\nQ: perl 5.12 / 5.13 features performance improvements. How much does that benefit my software?\n\n
  • \n
  • Many ideas of perlbrew comes from cpanm. (Distributing / Embedding modules... etc)\nrvm is a comprehensive implementation to build multiple rubies. It’s a big load of bash functions with bash scripts. But it works amazingly well.\n
  • easy to distribute - just one download !\nA pure-perl program pretty much runs anywhere just fine.\n
  • \n
  • These tools I wrote / encountered all feature just one simple job and only that.\n\nThey do not have many sub-commands or arguments so there are very easy to learn.\nNor are they big packages that takes longer to install or to load and run.\n
  • These tools I wrote / encountered all feature just one simple job and only that.\n\nThey do not have many sub-commands or arguments so there are very easy to learn.\nNor are they big packages that takes longer to install or to load and run.\n
  • \n
  • github/social coding is working!\n
  • github/social coding is working!\n
  • \n

Perlbrew Perlbrew Presentation Transcript

  • Kang-min Liu @gugod
  • /me@gugod, , Kang-min LiuWeb programmerCPAN Author for ~100 distributionshttp://perlbrew.pl
  • /me@gugod, , Kang-min Liu{ Perl, Ruby, Javascript, HTML, CSS,SQL, Photoshop } programmerCPAN Author for ~100 distributionshttp://perlbrew.pl
  • perlbrew
  • ←/usr/bin/perl/usr/local/bin/perl/opt/local/bin/perl/home/gugod/local/bin/perl
  • ←/usr/bin/perl5.8.8/usr/bin/perl5.10.0/usr/bin/perlsite_lib is preserved after upgrade@INC gets longer and longer.
  • The awesomenessperl is very backward compatibleIdeal for productionkeep upgrading perl is generally OKdon’t necessarily have to upgradecpan modules following a perlupgrade.
  • The huhCPAN modules are not necessarilybackward compatible.XS modules might need to berecompiled with new perlUpgrading modules might not beavoidable.
  • The hmmThe current CPAN architecture sort ofencourages upgrading The default is to install the latest version of modules.Upgrading CPAN modules isn’tnecessarily smooth.
  • The errErrors happens at runtimeXS errors happens at install /compile time and it is ^%@&* tosolve.
  • Worst of allHave to upgrade perl before doing allthat. an all-in-ish move
  • Worst of allDirty state 100 CPAN modules are updated 1 failedCan’t easily revert
  • retreatcp /usr/bin/perl${old} /usr/bin/perl old perl does not contain new site_lib
  • But what ifUpgrade perl for... performance bug-fixes evaluation
  • PracticalsModule authors have to correctlyspecify module dependencies.Module users have to run tests inorder to reveal runtime errors. assuming there are sufficient numbers of tests
  • perlbrew A tool to installdifferent versions of perls
  • admin-freeperl installation management
  • beer-driven softwaredevelopment
  • rvm1.8, 1.9, ree, jruby, rubinus, macruby, maglev, ironruby
  • perlbrew5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15
  • Installation#1curl -kL http://xrl.us/perlbrewinstall | bash#2cpan -i App::perlbrewperlbrew init
  • Usageperlbrew install perl-5.12.2perlbrew install perl-5.13.5perlbrew install perl-5.10.1perlbrew install perl-5.8.8 * Internet connection is required
  • Usageperlbrew use perl-5.14.2perlbrew use perl-5.15.5perlbrew switch perl-5.14.2perlbrew off
  • Usageperlbrew list
  • > 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
  • Usageperlbrew lib
  • Usageperlbrew lib listperlbrew lib create nobitaperlbrew lib create perl-5.14.2@nobitaperlbrew use perl-5.14.2@nobitaperlbrew lib delete perl-5.12.3@nobita
  • cd ~/src/App-Awesomeperlbrew use perl-5.10.1@app-awesomeperlbrew use perl-5.14.2@app-awesomecd ~/src/Module-Awesomeperlbrew use perl-5.10.1@nobitaperlbrew use perl-5.14.1@nobitaperlbrew use perl-5.14.2@nobita
  • perlbrew use perl-5.10.1@app-awesome
  • perl installation nameperlbrew use perl-5.10.1@app-awesome
  • local::lib nameperlbrew use perl-5.10.1@app-awesome
  • perlbrew use perl-5.10.1@app-awesome
  • eval `perl -Mlocal::lib=~/.perlbrew/libs/perl-5.10.1@app-awesome/`
  • % 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
  • perlbrew.pl 0.30
  • Propertiesisolated perl installations bin, site_lib, local::libinstall a new version ≠ upgrade @INC does not include old site_lib
  • Benefits`sudo cpan` is no moreeasier-to-clean perl environments Nuke the whole thing to clean the messNo old @INC
  • Benefitsper-app isolated perl environmentssetup. avoid, in advance, any possible incompatible issues with other apps. know your libs
  • Benefitsavoid lib conflicts with what you hadinstall older versions of moduleswithout worries to break other appcode. cpanm http://URL.TO/Mo-0.1.tar.gz App::pmuninstall
  • RationaleDon’t mess up vendor perl too much.Learn new stuffs in the dev versionof perl. keep up with the fashion
  • RationaleTest modules or apps ... with newer perl ... with older perl
  • RationaleTest perl itself -Dusethreads -Duse64bitall -Duse64bitint Configure -h -D -U -A
  • Rationalespare some guts B, XS Better with a perl built with DEBUGGING
  • Thoughtsperlbrew « cpanm, ack, rvm
  • ThoughtsOne standalone program embed non-core modules very easy distribution runs a tiny bit faster
  • Thoughtsrvm bash programming master-piece developer-friendly experiences production uses
  • Further ThoughtsDeprecate switch/use to external perlImprove multi-user scenarioMore related tool to help developeridentify module upgrade failure, andrevert to a good state.
  • Further ThoughtsGood + Simple toolkitKeep new-comers by not frustratingthemGrow the community
  • Simple is Hard
  • Developmenthttp://github.com/gugod/App-perlbrew49 contributorsFeedback github issue / pull requests rt.cpan.org #perlbrew on twitter
  • Developmenthttp://perlbrew.pl Documentation / Updates A static version of github Wiki
  • Thank You