This is a two-part question on the use of CPAN.pm as invoked by perl -MCPAN -e shell. The first part discusses a persistent problem for me; the second discusses a problem I observed only for the first time tonight.

First: On my Windows box at work, the CPAN shell installs modules (at least those without XS) lickety-split, no problemo. Likewise on my Linux box. But on my iBook (Darwin 10.3, Perl 5.8.4) -- which has become my primary development tool -- it takes forever, and does so every time I go to use it.

Tonight I was trying to install Spork. Tried to install it manually at first, then got caught by two prerequisites. So I figured I'd try the shell.

cpan> install Spork CPAN: Storable loaded ok Going to read /Users/jimk/.cpan/Metadata Database was generated on Mon, 07 Feb 2005 23:44:07 GMT CPAN: LWP::UserAgent loaded ok Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz

At this point, a pause of more than 5 minutes ensued. And this always happens.

LWP failed with code[400] message[FTP return code 000] Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz Couldn't fetch 01mailrc.txt.gz from ftp.perl.org

More time passed. I went to the bathroom and shaved.

Issuing "/usr/bin/ftp -n" Trying 207.45.221.24... Connected to ftp.cpan.ddns.develooper.com. 220 mirror.teleglobe.net server ready

Only now did things speed up. Allow me to skip ahead to what I think is the next relevant part of the output.

200 Type set to I. local: 01mailrc.txt.gz remote: 01mailrc.txt.gz 500 EPSV not understood. 227 Entering Passive Mode (207,45,221,24,231,210). 150 Opening BINARY mode data connection for 01mailrc.txt.gz (100125 by +tes) 100% |*************************************| 97 KB 212.80 KB/s +00:00 ETA 226 Transfer complete. 100125 bytes received in 00:00 (189.75 KB/s) 221-Goodbye from mirror.teleglobe.net hosted in Newark, NJ 221 GOT /Users/jimk/.cpan/sources/authors/01mailrc.txt.gz Going to read /Users/jimk/.cpan/sources/authors/01mailrc.txt.gz CPAN: Compress::Zlib loaded ok Issuing "/usr/bin/ftp -n" Trying 207.45.221.24... Connected to ftp.cpan.ddns.develooper.com. 220 mirror.teleglobe.net server ready

And skipping ahead again:

local: 02packages.details.txt.gz remote: 02packages.details.txt.gz 500 EPSV not understood. 227 Entering Passive Mode (207,45,221,24,202,125). 150 Opening BINARY mode data connection for 02packages.details.txt.gz +(369742 bytes) 100% |*************************************| 361 KB 385.93 KB/s +00:00 ETA 226 Transfer complete. 369742 bytes received in 00:00 (369.14 KB/s) 221-Goodbye from mirror.teleglobe.net hosted in Newark, NJ 221 GOT /Users/jimk/.cpan/sources/modules/02packages.details.txt.gz Going to read /Users/jimk/.cpan/sources/modules/02packages.details.txt +.gz Database was generated on Tue, 21 Jun 2005 05:57:41 GMT Issuing "/usr/bin/ftp -n" Trying 207.45.221.24... Connected to ftp.cpan.ddns.develooper.com. 220 mirror.teleglobe.net server ready

Are the long delays I'm experiencing due to the fact that ftp.perl.org is the first place my shell looks? Or are the delays due to LWP::UserAgent and Net::FTP, which never seem to work?

2. As I said at the outset, I was trying to install Spork. Once I finally made a connection, this was the output I got:

GOT /Users/jimk/.cpan/sources/modules/03modlist.data.gz Going to read /Users/jimk/.cpan/sources/modules/03modlist.data.gz Going to write /Users/jimk/.cpan/Metadata Running install for module Spork Running make for I/IN/INGY/Spork-0.20.tar.gz mkdir /Users/jimk/.cpan/sources/authors/id/I/IN: Permission denied at +/usr/local/lib/perl5/5.8.4/CPAN.pm line 2342

AFAICR, this was the first time I ever encountered this error. The relevant section of CPAN.pm reads as follows:

sub localize { .... my($aslocal_dir) = File::Basename::dirname($aslocal); File::Path::mkpath($aslocal_dir); # line 2342 $CPAN::Frontend->mywarn(qq{Warning: You are not allowed to write i +nto }. qq{directory "$aslocal_dir". I\'ll continue, but if you encounter problems, they may be due to insufficient permissions.\n}) unless -w $aslocal_dir;

Can anyone diagnose either problem? TIA.

Jim Keenan


In reply to Why is the CPAN shell not DWIMming? by jkeenan1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.