I'm with hippo; not sure why you are doing this but here are some ideas.

First, MetaCPAN has its own module. Borrowed directly from MetaCPAN::Client's own Pod:

#Or, to get either the given version of a release, or the latest: my $releases = $mcpan->release( { all => [ { distribution => 'GraphViz2' }, ($version ? { version => $version } : { status => 'latest' }), ], } );

My guess is that you are trying to find out what is latest and greatest with a module. If you are not doing that perhaps you should be trying to ensure that you have the correct version installed. There are modules specifically designed for this but, to me, unless a script has no dependencies I simply do not see why people do not write up some actual tests.

#!/bin/bash perl -MTest::More=no_plan -e 'my $prio = shift; if (use_ok(qq~$prio~)) + { no strict q~refs~; print ${$prio . qq~::VERSION~} . qq~\n~} else { +print qq~WTF!!!!!!\n\n~};' Exporter

Prints...

ok 1 - use Exporter; 5.78 1..1

Whereas...

perl ... BLAHMODULE

Prints...

not ok 1 - use BLAHMODULE; ... WTF!!!!!!

The above is actualy bad usage but I wanted to demonstrate that you can check for versions on the command line via passing in the module name. The use_ok() method in Test::More takes a version:

use_ok(qq~CGI~,9.999);

Which fails, of course, because that is not the installed version.

Celebrate Intellectual Diversity


In reply to Re: metacpan fastapi can't find the Config module by InfiniteSilence
in thread metacpan fastapi can't find the Config module by Anonymous Monk

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.