in reply to Perl modules Version Help!

I've assumed you meant "... pass a Perl module at a time ...". If that's right, this does what you want using Module::Info:

#!perl use 5.12.0; use warnings; use Module::Info; while (my $module = <>) { chomp $module; my $mod_info = Module::Info->new_from_module($module); if (! $mod_info) { warn qq{Can't find module: $module\n}; next; } say join q{ v}, $module, $mod_info->version(); }

Here's some sample output:

$ version_prob.pl Carp Carp v1.15 Scalar::Util Scalar::Util v1.23 Module::Info Module::Info v0.32 blah Can't find module: blah Data::Dumper Data::Dumper v2.126 <Ctrl-D>

-- Ken

Replies are listed 'Best First'.
Re^2: Perl modules Version Help!
by Anonymous Monk on Nov 10, 2010 at 16:44 UTC
    Why it needs to use "use 5.12.0;". It would not work with other versions?

      Change 5.12.0 to strict and say to print (and append a newline) if you want.

      -- Ken