|
Helping ordinary people create extraordinary websites! |
Automate Perl Module DeploymentBy Martin C. Brown2005-04-27
Automating CPAN Most people are familiar with CPAN as an interactive shell for building and installing Perl modules. What many don't realize is that the CPAN module that provides this functionality is actually just a wrapper around an internal application program interface (API). For example, to generate a list of installed modules that are out of date compared with the versions available on CPAN, you can simply call CPAN::Shell->r. Listing 1 provides an example of the command and its output. Listing 1. Code to generate a list of outdated modules $ perl -MCPAN -e 'CPAN::Shell->r'To install these modules automatically so that you are up to date, embed the call to CPAN::Shell->r in a call to the CPAN::Shell->install function: $ /usr/local/bin/perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)' This code dumps the information you see in Listing 1, then installs each module to bring it up to date. Tutorial Pages: » Scripts go Beyond CPAN to Ease Network Installations » Perl Module Installation » Automating CPAN » Automating CPAN Across a Network » Use CPAN to Create a Rigid Installation » Conclusions » Resources First published by IBM DeveloperWorks
|
|