Try this:

#! /usr/bin/perl use strict; use warnings; use CPANPLUS::Backend; # this will need to be more clever in the general case # (cross platform paths, odd locations, generated code, etc.) sub find_pod { my ( $dir, $module_name ) = @_; my $module_path = join '/', split /::/, $module_name; foreach my $extension ( qw( pod pm ) ) { my $file = "$dir/lib/$module_path.$extension"; return $file if -e $file; } return; } sub get_description_from_pod { my ( $filename, $module_name ) = @_; open my $fh, "<", $filename or die "open failed ($!)\n"; while ( my $line = <$fh> ) { chomp $line; return $1 if $line =~ m/^$module_name\s+-\s+(.*)$/s; } return; } sub description { my $module = shift; return $module->description if $module->description; $module->fetch or die CPANPLUS::Error->stack_as_string; my $dir = $module->extract or die CPANPLUS::Error->stack_as_string +; return 'unknown' unless my $pod_file = find_pod( $dir, $module->na +me ); return get_description_from_pod( $pod_file, $module->name ) or 'unknown'; } my $cb = CPANPLUS::Backend->new; my @modules = $cb->search( type => 'module', allow => [ qr/\ACatalyst: +:Plugin/ ] ); print $_->name, " : ", description( $_ ), "\n" foreach @modules

In reply to Re^7: Searching for Modules and Descriptions on CPAN Remotely by adrianh
in thread Searching for Modules and Descriptions on CPAN Remotely by ghenry

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.