Sunday, April 10, 2011

Install from Perl modules from CPAN without confirmation

If need to install modules from CPAN, especially if you want to install a whole bunch in one go without having to confirm every ten seconds try running your install as follow:

PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'install My::Module'

Additionally if you want to make sure that the install script will pull all the required dependencies (should be by default, but heh ...):

cpan> o conf prerequisites_policy follow
cpan> o conf commit

That's it.