http://qs1969.pair.com?node_id=817236

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

Dear Wise Monks

I want to automate the downloading of the .tar.gz install file for a list of CPAN Modules. This is easy for the module Algorithm::Interval2Prefix. Simply append Algorithm-Interval2Prefix to http://search.cpan.org/dist/ but this doesn't work other modules like Apache::Session::File. Is there some feature on the cpan.org website that I'm not aware of?

Thanks

  • Comment on Programmatic way to get CPAN Module tarballs?

Replies are listed 'Best First'.
Re: Programmatic way to get CPAN Module tarballs?
by ctilmes (Vicar) on Jan 13, 2010 at 17:43 UTC
    Try the CPAN module itself.

    CPAN::Distribution::get might do the trick.

      thanks! exactly what I needed!
        #!/usr/bin/perl -w use strict; use CPAN; my @cpanmods = qw / Algorithm::Interval2Prefix \ Apache::Session::File \ ... other modules go here XML::Generator /; for my $cpanmod ( @cpanmods ) { for my $mod (CPAN::Shell->expand("Module", $cpanmod )) { print "http://search.cpan.org/CPAN/authors/id/" . $mod +->{'RO'}{'CPAN_FILE'} . "\n"; } }
Re: Programmatic way to get CPAN Module tarballs?
by Anonymous Monk on Jan 13, 2010 at 17:44 UTC