Monday, 1 November 2010

Problems with your local perl install?

Try the following uber 1337 commands (based on this):

mv ~/perl5 ~/notperl5
wget -O - http://cpanmin.us | perl - -L ~/perl5 --self-upgrade local::lib


ZOMG!



OK, now add your ~/perl5 dir into git...
cd ~/perl5/ ; git init ; git add . ; git commit -m 'initial import'

This will help you keep things in order over time.


Example:
cpanm Bio::DB::Sam


You can then use git to see exactly what you did, and commit if it worked OK. i.e.
git add . ; git commit -m 'BioPerl and Bio::DB::Sam installed'

(Once you have confirmed that it's working.)


Once your local::lib is in git, you can do lots of stuff like if something is breaking, just edit it in there to insert debugging or whatever and then just reset --hard to get rid of it after you figure out what is going on, etc.



Thanks to rbuels on irc://irc.freenode.net/#bioperl for helping with this!
(All the above is his doing).