Wednesday, September 19, 2007

Using CPAN Modules

FAQ: Here are some of my frequently used commands for CPAN

# Interactive mode % sudo perl -MCPAN -e shell # Installing a module % sudo perl -MCPAN -e "install Some::Module" # List of versions of installed and available modules % sudo perl -MCPAN -e 'CPAN::Shell->r' # Upgrade all modules % sudo perl -MCPAN -e \ 'CPAN::Shell->install(CPAN::Shell->r)'

Configuration: If you are getting this error

CPAN.pm needs either the external programs tar, gzip and bzip2 installed. Can’t continue.
Try this:
shell> sudo perl -MCPAN -eshell cpan> o conf tar /bin/tar cpan> o conf bzip2 /bin/bzip2 cpan> o conf gzip /bin/gzip cpan> o conf commit

No comments: