Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

How to get a list of available modules from a cpan mirror

by xorl (Deacon)
on May 25, 2012 at 13:02 UTC ( [id://972417]=perlquestion: print w/replies, xml ) Need Help??

xorl has asked for the wisdom of the Perl Monks concerning the following question:

We have a local cpan mirror with "approved" modules for use within the company. cpan is configured so that it only uses our local mirror.

Is there some easy way to get cpan to tell me what modules are available?

Thanks in advance.

  • Comment on How to get a list of available modules from a cpan mirror

Replies are listed 'Best First'.
Re: How to get a list of available modules from a cpan mirror
by Anonymous Monk on May 25, 2012 at 13:34 UTC

    Is there some easy way to get cpan to tell me what modules are available?

    Use cpanp -m regex

    $ cpanp -m App::Ack 1 App::Ack 1.96 PETDANCE 2 App::Ack::Plugin PETDANCE 3 App::Ack::Plugin::Basic PETDANCE 4 App::Ack::Repository PETDANCE 5 App::Ack::Repository::Basic PETDANCE 6 App::Ack::Resource PETDANCE 7 App::Ack::Resource::Basic PETDANCE

    Or, start cpan, and type h, to get interactive help, but remember, cpan -m is not the same as cpan> m

    cpan[1]> m /App::Ack/ Database was generated on Thu, 24 May 2012 20:07:03 GMT Module = App::Ack (PETDANCE/ack-1.96.tar.gz) Module = App::Ack::Plugin (PETDANCE/ack-1.96.tar.gz) Module = App::Ack::Plugin::Basic (PETDANCE/ack-1.96.tar.gz) Module = App::Ack::Repository (PETDANCE/ack-1.96.tar.gz) Module < App::Ack::Repository::Basic (PETDANCE/ack-1.96.tar.gz) Module = App::Ack::Resource (PETDANCE/ack-1.96.tar.gz) Module < App::Ack::Resource::Basic (PETDANCE/ack-1.96.tar.gz) 7 items found
Re: How to get a list of available modules from a cpan mirror
by moritz (Cardinal) on May 25, 2012 at 14:36 UTC
Re: How to get a list of available modules from a cpan mirror
by Khen1950fx (Canon) on May 25, 2012 at 15:14 UTC
    Assuming that CPAN is configured to use local, this will list all the installed and all the unavailable modules(uses modlist):
    #!/usr/bin/perl BEGIN { $| = 1; } use strict; use warnings; use CPAN; use Term::ANSIColor::Print; my $print = Term::ANSIColor::Print->new(); my $d = shift @ARGV; foreach $d (CPAN::Shell->expand("Module", "/./")) { $print->bold_black( "\n\tmodule: ", $d->id), $print->dark_blue( "\tauthor: ", $d->cpan_userid), $print->bold_black("\tcurrent version: ", $d->cpan_version), $print->dark_green( "\tinstalled version: ", $d->inst_version), $print->dark_red( "\t", $d->inst_file); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://972417]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-18 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found