in reply to Finding Module Versions - How Would You Do It?
G'day Tommy,
With older versions of Perl, I used to do:
$ perl -e 'use Test::More; print $Test::More::VERSION, "\n"' 0.98
With newer versions of Perl, I now use the slightly shorter:
$ perl -E 'use Test::More; say $Test::More::VERSION' 0.98
And to automate, using a selection of modules from your list, you could do something like:
$ module_list='Test::More English File::Find Test::Perl::Critic' $ for i in $module_list; do > echo $i > eval "echo \`perl -E 'use $i; say \$$i::VERSION'\`" > done Test::More 0.98 English 1.04 File::Find 1.19 Test::Perl::Critic 1.02
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding Module Versions - How Would You Do It?
by hippo (Archbishop) on Feb 13, 2013 at 14:37 UTC | |
by Ralesk (Pilgrim) on Feb 14, 2013 at 15:35 UTC |