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!

Version of Modules

Status
Not open for further replies.

tdatgod

Programmer
Jul 21, 2001
601
US
Hi,
I found the FAQ for listing which modules are installed on my system....

What modules do I have installed?
faq219-5657
Posted: 3 Feb 05

and using this method I can display all the modules on the system.

However since that does a directory walk, there is no VERSION information.

Is there a way to know which VERSION ( i.e 1.03 vs 1.2 ) of a particular Module is installed?

There were a couple examples on the CPAN site for obtaining versions,

perldoc perllocal

and one using

ExtUtils::Installed module

but when I try them on my Solaris box it tells me nothing is installed or just perl 5.6.1 is displayed and none of the other Modules.

Since the Output from the FAQ script shows lots of modules the CPAN script must not be working on my system.

Any Ideas?

Thanks in Advance.

from CPAN

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

use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
       print "$module -- $version\n";
}




 
Have you more than one version of Perl installed? Since you're specifying 5.6.1, and the modules you're assuming to find aren't showing up

logging into CPAN "user$ perl -MCPAN -e shell", should give you a option to query installed packages
Code:
[u][b]cpan>[/b][/u]i

HTH
--Paul



Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
You can frequently do print $MODULE::Version;

[root@localhost DBI-1.48]# perl -e 'use DBI; print $DBI::VERSION,"\n"'
1.48

Kordaff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top