It took me a few minutes to get this all working right, but try this one on for size. I may put this in snippets at some point after I clean it up a bit.

Basically it gives you a form that lists all of your modules in a dropdown box, you pick the module, click "Module details", and it will show you module name, version, and files contained within it, including full path to those files. It also links the module name to the appropriate CPAN module search, so you can find the documentation on it, and read up on how to use it.

Short and sweet.

Update: I turned this into a Snippet and added a bunch of new features, which you can find over here: MoDetails v0.2

#!/usr/bin/perl use strict; use CGI qw(:standard); use ExtUtils::Installed; my $script = $ENV{'SCRIPT_NAME'}; my $cpan = "http://search.cpan.org/search"; my $inst = ExtUtils::Installed->new(); my $cgi = CGI->new(); print header(), start_html(); print_form(); print_results($cgi) if $cgi->param('mod'); sub print_form { push my @modules, $inst->modules(); my $modname = $cgi->param('mod'); print start_form(-name =>"modules", -action =>"$script?mod=$modname"), popup_menu(-name =>'mod', -value =>\@modules), submit(-label=>'Module Details'), end_form; } sub print_results { my $module = $cgi->param('mod'); print p(font({-face=>'courier'}, b("Module"), ":", a({-href=>"${cpan}?query=$module&mode=module"}, "cpan://$module"))); print p(font({-face=>'courier'}, b("Version"), ":", $inst->version($module))); push my @filelist, $inst->files($module); print p(font({-face=>'courier'}, b("Files"), ":", br(), join br(), $inst->files($module))); } print end_html();

In reply to Re: Module Version Number? by hacker
in thread Module Version Number? by cal

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.