>Perl – Shell Subroutine


How to use Shell Subroutine to simply install CPAN module

The simplest and quickest method to install a CPAN module is to use the perl shell subroutine.
To run the shell subroutine from command-line, use:

# perl -MCPAN -e shell

This command runs Perl, loads the “CPAN” module into memory and runs the shell soubroutine.

So to install, for example, the WWW::Mechanize module you have to simply execute:

cpan> install WWW::Mechanize

and  the shell subroutine will connect to the internet cpan website and will download and automatically install your module.

Leave a Reply

Your email address will not be published. Required fields are marked *