My scripts require a new version of perl, which I have installed into a local directory, to avoid corrupting the packaged version of perl that comes with Debian.
I configured and installed a tarball of perl with:
Configure -des -Dprefix=/root/perl
make
make install
Then I called cpan with:
/root/perl/bin/perl -MCPAN -e shell
Every time I install a module I do this:
$/root/perl/bin/perl -MCPAN -e shell
cpan[2]> install Getopt::Long
cpan[2]> install WWW::Mechanize
cpan[2]> install File::Find::Rule
With a system version of perl I used to be able to do this from Bash:
$cpan -i DBI
How can I use a similiar command from bash, without needing to open up the cpan shell each time I need to install a module?
Edit: I should have read the documentation more thoroughly. The solution is:
/root/perl/bin/perl -MCPAN -e 'install Getopt::Long'
Or (Thanks, suddenmoves)
/root/perl/bin/cpan -i Getopt::Long