I ♥ perlbrew

I love perlbrew! I like to keep the version of Perl that I normally use as up-to-date as possible, but it's nice to keep other versions around for compatibility. Just now, I needed to know when readline got fixed. With perlbrew, it was faster to check directly than it was to look it up!

$ cat >> VentureBros
Hank
Dean
Brock
$ perlbrew switch perl-5.12.1
$ perl -e 'print while readline' VentureBros
Hank
Dean
Brock
$ perlbrew switch perl-5.10.1
$ perl -e 'print while readline' VentureBros
Hank
Dean
Brock
$ perlbrew switch perl-5.8.9
$ perl -e 'print while readline' VentureBros
Modification of a read-only value attempted at -e line 1.
$ perl -e 'print while <>' VentureBros
Hank
Dean
Brock


So in 5.10 and up, we can use readline for everything. But if we still care about 5.8, then we still need angle brackets.

2 Comments

It's a bit faster without perlbrew if you give all of your perls unique names, as I show in Effective Perl Programming. You don't have to switch:

$ perl -e 'print while readline' VentureBros
$ perl5.10.1 -e 'print while readline' VentureBros
$ perl5.8.9 -e 'print while readline' VentureBros
Modification of a read-only value attempted at -e line 1.
$ perl5.8.9 -e 'print while >' VentureBros

Leave a comment

About oylenshpeegul

user-pic I blog about Perl.