Print
Parent Category: Tutorials
Hits: 4227

There are many times when you need to install Perl modules and the CPAN install command uses
no command line arguments but you need.
For example you need to install DBD::mysql from the CPAN shell and you would like to do:
perl Makefile.PL --testdb=test --testuser=root --testpassword=supersecret --testhost=localhost
instead of just:
perl Makefile.PL
because installing DBD::mysql using the CPAN shell fails, as the connection to MySQL fails.
Solution:
Use the look command inside the CPAN shell to customize command line arguments.
Enter the CPAN shell: 
perl -MCPAN -e shell
Open a subshell in the DBD::mysql directory (will download the module if not already downloaded): 
look DBD::mysql
Execute any command as you would installing the module "manually": 
perl Makefile.PL --testdb=test --testuser=root --testpassword=supersecret --testhost=localhost
make
make test
make install
Exit the subshell, return to CPAN shell: 
exit
Exit the CPAN shell: 
exit

Note:

We use Hosting and VPS Hosting, from: www.star-host.org

We like and trust them.

Good prices, high security.