Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Retrieve list of used modules and their version numbers

by jmcnamara (Monsignor)
on Sep 07, 2006 at 11:54 UTC ( #571664=note: print w/ replies, xml ) Need Help??


in reply to Retrieve list of used modules and their version numbers


Here is a similar one that runs from the command line.

#!/usr/bin/perl -w use strict; for my $module (@ARGV) { my $version; eval "require $module"; if (not $@) { $version = $module->VERSION; $version = '(unknown)' if not defined $version; } else { $version = '(not installed)'; } printf " %-24s\t%s\n", $module, $version; } __END__ # Sample output. $ perl modver.pl Encode Foo strict Error::Simple Encode 2.10 Foo (not installed) strict 1.03 Error::Simple (unknown)

--
John.


Comment on Re: Retrieve list of used modules and their version numbers
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-07-31 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls