[Omaha.pm] FW: Checking for installed PERL modules

Jeff Bisbee jbisbee at gmail.com
Wed Jan 4 21:16:32 PST 2006


Been using this 'pmpath' script for years...

   #!/usr/local/bin/perl
   $module = shift;
   ($mod = $module) =~ s#::#/#g;
   die ("Need a module name\n") unless $mod;
   $mod .= '.pm';
   require $mod;
   print $INC{$mod} . " (" . ${$module . "::VERSION"} . ")\n";

On Jan 4, 2006, at 7:32 PM, Jay Hannah wrote:

> From: Sean J. Edwards
>> I found this on CPAN to check for installed modules:
>>
>> #!/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";
>> }
>
> Cool. "perldoc perllocal" is handy sometimes too.
>
> j
>
> _______________________________________________
> Omaha-pm mailing list
> Omaha-pm at pm.org
> http://mail.pm.org/mailman/listinfo/omaha-pm

Jeff Bisbee / jbisbee at gmail.com / jbisbee.com




More information about the Omaha-pm mailing list