Thursday, November 11. 2010

virtualenv for Perl

I absolutely love virtualenv for Python development. It allows me to develop Buildbot against several versions of Python and several versions of its dependencies, without modifying my system's Python installation at all!

Now, I need to do the same thing in Perl. So I thought I'd compare the two side-by-side.

virtualenv

# install virtualenv locally
wget http://bitbucket.org/ianb/virtualenv/raw/tip/virtualenv.py
# set up a sandbox
python virtualenv.py sandbox
# activate it
source sandbox/bin/activate
# start installing stuff
easy_install buildbot

local::lib

There is no local::lib gentoo ebuild! I'm sure there's a good reason, but that's odd all the same!

# install local::lib locally
wget http://search.cpan.org/CPAN/authors/id/G/GE/GETTY/local-lib-1.006007.tar.gz
tar -zxf local-lib-1.006007.tar.gz
cd local-lib-1.006007
perl Makefile.PL --bootstrap # (accept lots of defaults)
make test && make install
# activate it (permanently)
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)
# start installing stuff
perl -MCPAN -e install Config::General # (I have to accept the same defaults again??)

I think virtualenv is the clear winner here!


Trackbacks

No Trackbacks

Comments
Display comments as (Linear | Threaded)

*perlbrew (http://search.cpan.org/~gugod/App-perlbrew-0.15/lib/App/perlbrew.pm) is the closest thing Perl has to vritualenv. local::lib probably wouldn't have helped you that much.

No idea if it has a gentoo build though, but I would blame gentoo for that, not Perl.

#1 Andrew Jones (Homepage) on 2010-12-10 16:51 (Reply)

*Good to know - thanks!

#1.1 Dustin J. Mitchell (Homepage) on 2010-12-10 16:59 (Reply)

Add Comment


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Markdown format allowed
 
 

Notice

The postings on this site are my own and don't necessarily represent the opinions of Zmanda, Inc.