Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

RE: Find perl module version from command-line

by Fastolfe (Vicar)
on Oct 18, 2000 at 02:27 UTC ( #37242=note: print w/ replies, xml ) Need Help??


in reply to Find perl module version from command-line

Things like this are frequently done in conjunction with CPAN lookups. Many people don't realize that the CPAN module itself can be used in your own scripts. You can extend lachoy's example a lot further by using CPAN, at the expense of a lot of time:

#!/usr/bin/perl use CPAN; printf("%-20s %10s %10s\n", "Module", "Installed", "CPAN"); foreach $a (@ARGV) { foreach $mod (CPAN::Shell->expand("Module", $a)){ printf("%-20s %10s %10s %s\n", $mod->id, $mod->inst_version eq "undef" || !defined($mod->inst_version) ? "-" : $mod->inst_version, $mod->cpan_version eq "undef" || !defined($mod->cpan_version) ? "-" : $mod->cpan_version, $mod->uptodate ? "" : "*" ); } }
Running with arguments: DBI /DBD::/
Module Installed CPAN DBI 1.13 1.14 * DBD::ADO 0.14 1.17 * DBD::ASAny - 1.09 * DBD::Adabas - 0.2003 * DBD::Altera - - * DBD::CSV - 0.1024 *
...etc. Though if all you're interested in is the installed version of modules, you're FAR better off going with lachoy's script, since the code above will rely upon CPAN data, which will require time to fetch, extract and browse.


Comment on RE: Find perl module version from command-line
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://37242]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-12-22 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (133 votes), past polls