Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I tell what CPAN modules are installed?

Status
Not open for further replies.

CherylD

Programmer
May 1, 2001
107
CA
I have just installed a new development server, and since I'm new at this it's taking a while to get it up to the same point as the real server. I'm not sure what modules the other server has. Is there somewhere to easily tell? The OS is Solaris 7 and running perl 5.

Thanks.

Cheryl
 
The easiest way I have found to do this is just write a quickie script to test for individual modules. Just do

Code:
#!/usr/local/bin/perl -w

use CGI;

run that and if CGI is not installed you will get an error. I am not sure if there is a command to dump a list of all modules.
 
Good question. I know how to find this out on a Windows system using Active State's Perl. Running "ppm" and "query" will list all of the installed modules. As for a unix system, I'm not sure. In the past, I have just checked the module directories. If you just want all of the same modules as another server, just copy the Perl's library (typically /usr/lib/perl5) to the new server.
 
I'm not sure if this will work on the shell you're using (I use bash), nor do I know if you have access to the "find" command, but following is the one-liner that I use to view all of my modules:
Code:
for x in `perl -e 'print join"\n",@INC'`; do echo -e \\n$x; find $x -iname *.pm; done > modules.txt
Then modules.txt contains the full list. Note that this is a shell script, not a perl script.

Hope this helps,

brendanc@icehouse.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top