in reply to Find perl module version from command-line
I was going to post the following to the Snippets section when I came across your nicer version:
perl -le 'eval "require $ARGV[0]" and print ${"$ARGV[0]::VERSION"} +' Module
Your method of printing the version number is cleaner as well:
perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Mod +ule
I'm glad that I searched before posting. ;-)
John.
--
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Find perl module version from command-line
by cld (Initiate) on Jan 03, 2008 at 23:27 UTC | |
by naChoZ (Curate) on Jan 04, 2008 at 22:56 UTC | |
by Anonymous Monk on Feb 21, 2012 at 13:26 UTC | |
by Corion (Patriarch) on Feb 21, 2012 at 13:34 UTC | |
by educated_foo (Vicar) on Feb 21, 2012 at 17:08 UTC | |
by geelsu (Initiate) on Feb 21, 2012 at 14:42 UTC | |
| |
by geelsu (Initiate) on Feb 21, 2012 at 13:34 UTC |
In Section
Cool Uses for Perl