Is that perl 5.12 on your netbook?

OH YEAH!

Just finished installing the brand spanking new Perl 5.12 on the netbook on my "perl" account, with which I tested already earlier -RC releases with my personal code.

It's fair to say that the user experience has gone a long way from the "old days" of manual configuration, installation, swearing and $ENV madness. Hell, one doesn't even need local::lib anymore!

All I had to do to test 5.12 after creating my "perl" account was:

curl -LO http://xrl.us/perlbrew
chmod +x ./perlbrew
./perlbrew install
rm perlbrew 
~/perl5/perlbrew/bin/perlbrew init
echo 'source /home/perl/perl5/perlbrew/etc/bashrc' >> .bashrc  
source .bashrc
echo $PATH
perlbrew install perl-5.12.0
# wait some time..
perlbrew switch perl-5.12.0
perl -V

There you go, shiny new Perl to be used!

git clone git://github.com/miyagawa/cpanminus.git
cd cpanminus
make test install
cpanm YAML
# and YAML's installed
perl -E'use YAML;say Dump({"sound"=>["YAML!"]})'

On my desktop machine instead I started versioning ~/perl5/ under Git starting with -RC4, adding and committing all the cpanm-installed modules as I went. This helped a lot with remembering which modules got installed (although perldoc perllocal also keeps track of that!) in order to install them again when testing the new -RC or the new 5.12. Although, I wasn't entirely consistent with the naming of the commits. Meh.

I only had a couple issues with modules like Gearman::XS which required the latest and greatest library which wasn't available on Ubuntu Lucid. I simply reset the Git tree when the builds didn't work. For Gearman::XS I downloaded, committed, tested and installed the latest version (having it Git-versioned helps) and then rebuilt Gearman::XS with a couple environment variables (also noted on the commit logs).

One learns from their mistakes, so I'll use another format for the commit messages when I'll install and test 5.12 on my desktop account: I'll make sure to "tag" the cpanm commits as such (for example, with which cpanm command I issued and with the list of additional modules installed after the blank line in the Git commit) and the modules requiring installation of other libraries also in a different and sensible way.

The idea would be to be able to do something like the following, and being able to have a good list of commands I need to type to have all my favourite modules on the new Perl version with minimum effort:

git log --pretty=oneline | cut -d ' ' -f 2- | tac

From there, I'll just go through my ~/GIT/ and run the test suites there. Maybe I'll have some code ready for the next post.

For now, I just want to say THANKS to the wonderful Perl 5 Porters who did manage to get the next stable release out as promised. I look forward to 5.14!

-marco-

1 Comment

Gah! "perlbrew switch" has no effect on Debian 6 or Ubuntu 10.10.

Leave a comment

About Marco Fontani

user-pic Slicing and splicing onions