So, I was once again setting up CPAN behind a firewall/proxy, and it was a from source build of perl, with no LWP - just Net::FTP. I pretty quickly stumbled on Forcing CPAN.pm to ignore LWP/Net::FTP and use wget/lynx etc which solved the Net::FTP timeout/failure problem. For some reason though, it wasn't finding/attemtping to use any of the command line clients, and so download of the mirror list would fail. So I primed CPAN::Config->{wget} with the path to wget on the box, and viola - off and running.
#!/appl/my/perl/bin/perl use CPAN(); $CPAN_has_usable = \&CPAN::has_usable; local *CPAN::has_usable = sub { return if $_[1] =~ /^(?:Net|LWP)/; return $CPAN_has_usable->( @_ ); }; $CPAN::Config->{wget} = "/usr/sfw/bin/wget"; CPAN::shell();
My question is, does anyone have anything... simpler, that would work too? Did I miss something in my googling that addresses this already?

This is one I'll definitely keep in my toolkit... but ideally, something simple enough to recall from memory would be even better. I guess this would suffice - I'd just have to be patient on the Net::FTP timeout:

perl -MCPAN -e'$CPAN::Config->{wget}="/usr/sfw/bin/wget";CPAN->shell() +'

In reply to CPAN, firewall, proxy and FirstTime config... by dcvr69

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.