Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by xorl (Deacon)
on May 25, 2012 at 13:02 UTC ( #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
Node Status?
node history
Node Type: perlquestion [id://972417]
Approved by marto
Front-paged by Corion
help
Chatterbox?
[Discipulus]: 'give man a fish erix it sonds like a push towards omosexuality.. ;=)
[Discipulus]: see Re: from txt file to array erix
[erix]: yeah, I ask for the text (I don't see signatures)
[Discipulus]: dear brother karl has "Furthermore I consider that Donald Trump must be impeached as soon as possible" in his sig
[erix]: ah, thanks Discipulus
[1nickt]: erix perhaps you could kindly point out your technique to roho and everyone will be happy.
[Discipulus]: but i'm also animalist, so i' hirted by 1nickt's sig: The way forward always starts with a mammal test... grin..
[erix]: I might if I did remember. It's probably somewhere in the site docs
[uhClem]: I don't favor that sort of thing around here but the place for our politics is wherever we live.
[uhClem]: And besides, the objection to it was off-topic.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-06-22 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.