I usually end up using this:
#!/usr/bin/perl BEGIN { $| = 1; $^W = 1; } use strict; use warnings; use CPAN; use Term::ANSIColor::Print; my $print = Term::ANSIColor::Print->new(); my @mods = (qw( Scope::Guard Algorithm::C3 Class::C3 Exporter Sub::Install Encode Test Test::More Test::Harness Text::Wrap Pod::Escapes Pod::Simple Pod::Man File::Spec ExtUtils::MakeMaker namespace::clean namespace::autoclean Class::MOP Declare::Constraints::Simple Package::DeprecationManager Sub::Name Try::Tiny Test::Fatal Test::Requires Dist::CheckConflicts Data::OptList Devel::GlobalDestruction List::MoreUtils MRO::Compat Params::Util Scalar::Util Sub::Exporter Task::Weaken Fey Fey::ORM IO::KQueue File::ChangeNotify KiokuDB Moose Moose::Meta::Class MooseX::Aliases MooseX::Attribute::Prototype MooseX::SlurpyConstructor MooseX::Role::WithOverloading MooseX::ClassAttribute MooseX::MethodAttributes MooseX::NonMoose MooseX::POE MooseX::Role::Parameterized MooseX::SemiAffordanceAccessor MooseX::StrictConstructor MooseX::UndefTolerant Package::Stash::XS Package::Stash Eval::Closure Locale::BR DateTime::TimeZone SQL::Translator Set::Object Test::Moose Test::XML::Compare Any::Moose IO::Moose Readonly Readonly::XS)); foreach my $mod(@mods) { my (@matches) = grep(($_ eq $mod), @mods); if(@matches) { foreach $mod( CPAN::Shell->expand("Module", $mod)) { $print->bold_black( "\n\tmodule: ", $mod->id), $print->bold_blue( "\tcurrent version: ", $mod->cpan_version), $print->bold_black( "\tinstalled version: ", $mod->inst_version); } } }

In reply to Re: Finding Module Versions - How Would You Do It? by Khen1950fx
in thread Finding Module Versions - How Would You Do It? by Tommy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.