Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

All CPAN Modules

by jnbek (Scribe)
on Apr 30, 2013 at 02:16 UTC ( #1031300=perlquestion: print w/replies, xml ) Need Help??
jnbek has asked for the wisdom of the Perl Monks concerning the following question:

I was just curious, is there a Bundle that basically allows you to install every module on CPAN? Something I can:

 cpan ALL::CPAN::Modules

and just have it slap it and install the whole enchilada?

Replies are listed 'Best First'.
Re: All CPAN Modules
by davido (Archbishop) on Apr 30, 2013 at 02:55 UTC

    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.


      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/");

        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 blacklist, because the most common reason for a smoker blacklisting 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.


Re: All CPAN Modules
by syphilis (Chancellor) on Apr 30, 2013 at 10:02 UTC
    There's Acme-Everything and Bundle-Everything, but neither fits the bill exactly.

    The former will install any missing module (and dependencies) needed to utilise any specified method in any class that the code calls ... but, IIRC, you may have to be running as root for that to work on *nix type systems.

    And the latter claims to contain only 5500 modules (and not everything) ... and then there's also the caveat that it may not actually install them. (I don't know why that is. Perhaps that's just its way of telling you that you may need to be running as root.)

Re: All CPAN Modules
by marto (Archbishop) on Apr 30, 2013 at 10:12 UTC

    It doesn't make sense to me to even try to install every module on CPAN. Some are OS specific, many have external dependancies you may not have. If you could install every module you'd use a lot of disk space and chances are you'd never use a large percentage of them. I do think it's wise to keep a local mirror (described here) handy.

      Well that's the point, I'm not building them to try and use all of them, I'm conducting research into some things, and it involves installing every module on CPAN that will install on the build system. Again, I realize there will be a number of modules that won't build, due to OS constraints, wrong CPU architectures, old crappy code that hasn't been touched since 1998, whatever. I'm OK with all that :) I don't want to spoil anything, so I won't divulge too much more, but I already have my local CPAN mirror up, forked MetaCPAN on Github and formulated my evil plan to take over the world.. err umm test installing CPAN modules on steroids.. :-P. I want to benchmark build times, and a lot more. All y'all have been most excellent (as always) with the suggestions. I'll report and reveal more as I go.

      Perl 4LYF!!

        "I'll report and reveal more as I go."

        Please do, I'm curious about the nature of your projet.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1031300]
Approved by davido
LanX he he

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2018-07-20 10:38 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (428 votes). Check out past polls.