Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: All CPAN Modules

by davido (Cardinal)
on Apr 30, 2013 at 02:55 UTC ( [id://1031304]=note: print w/replies, xml ) Need Help??


in reply to All CPAN Modules

At least 10% of CPAN won't even build on a given system (yes, I pulled that figure out of thin air). If your goal is to have CPAN available to you even when you're not "connected", you're probably better off mirroring your own personal mini-CPAN.

There are tools that help you in this regard. Start by looking at CPAN::Mini. Depending on what problem you're trying to solve there are many other tools out there, but it wouldn't be worthwhile recommending one without knowing what you need it for.


Dave

Replies are listed 'Best First'.
Re^2: All CPAN Modules
by jnbek (Scribe) on Apr 30, 2013 at 03:10 UTC

    Well, Dave, I too favor choosing arbitrary data to illuminate a particular fact that my data set is incomplete on, mucho kudos :D (I'd have leaned higher in the order of 16.54% personally.)

    however, I'm looking to build a build bot that will compile and install any and every module given, I already have a local mirror for the CPAN, I just want an easy way to install all the modules found. I realize, that OS and Arch specific modules won't build, I don't forsee much luck with Win32::API on a FreeBSD server, or getting that OS/2 File module to actually do anything on a Linux server. I guess anything that gives me a list of all the modules available on a CPAN mirror would be fine. I just need a list to iterate on is all.

      Rather than trying to install everything, it's better to break your list down into manageable chunks. For example to install all modules beginning with "A":
      #!/usr/bin/perl use strict; use warnings; use CPAN; print $_->install() foreach CPAN::Shell->expand("Module", "/^A/");
      I usually break it down even further. For example, all modules starting with "Aa", "Ab", etc.
      #!/usr/bin/perl use strict; use warnings; use CPAN; print $_->install() foreach CPAN::Shell->expand("Module", "/^Aa/"); print $_->install() foreach CPAN::Shell->expand("Module", "/^Ab/");
      And for an entire namespace, say Catalyst:
      print $_->install() foreach CPAN::Shell->expand("Module", "/^Catalyst/");

        Very nice!! Thanks these ideas will work very nicely.

      If you do craft a solution that iterates over "everything", there's probably some prior art to learn from by looking at how the CPAN smoke testers discover and test everything.

      You might want to pay particular attention to what the CPAN testers blocklist, because the most common reason for a smoker blocklisting a distribution is when they discover that the build process hangs nastily, or otherwise blocks forever. (I discovered that first hand when a mistake in one of my dists caused some smokers to hang.) Knowing which modules they consider impossible or too expensive to test will help you to avoid the same issues.


      Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1031304]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found