If you need a Perl module that is not currently installed, and especially if you need a Perl module that can't be installed by pkgsrc (the “3rd party packaging system” used on Shared Accelerators) then you can set up CPAN to automate the installation of modules.
These instructions are based on these at sial.org.
Make your own CPAN directory, and the directory your modules will be stored in:
$ mkdir -p ~/.cpan/CPAN $ mkdir -p ~/lib/perl5
Download this Config.pm file at sial.org and put it into the CPAN directory you just made, so it's at ~/.cpan/CPAN/MyConfig.pm
In the MyConfig.pm file change all occurrences of HOMEDIRFIX to /users/home/yourusername (using YOUR username of course).
In MyConfig.pm change /usr/bin/wget to /usr/sfw/bin/wget.
Test that MyConfig.pm's syntax is OK:
$ perl -c ~/.cpan/CPAN/MyConfig.pm MyConfig.pm syntax OK
Add the following to your ~/.bash_profile file (if you don't have one, create an empty text file with that name and put this in it):
if [ -d $HOME/lib/perl5 ]; then
PERL5LIB=${PERL5LIB:+$PERL5LIB:}$HOME/lib/perl5
fi
export PERL5LIB
Log out and back in again for the above to take effect (is there a way to do this without logging out and in?).
That's it! You should now be able to install Perl modules using CPAN. Here's how you'd install Config::Simple for example:
$ cpan cpan> install Config::Simple ... /usr/bin/make install -- OK cpan> exit $
OK, not quite done. This will work for perl scripts you run on the command line; the lines we added to your .bash_profile tells our scripts where to find the new modules. For any scripts you run another way, such as via cron, you'll need to add a line before “use”ing any of your modules:
#!/usr/bin/perl use lib "/users/home/yourusername/lib/perl5"; use Config::Simple;
Again, of course, replacing yourusername with your own.