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?
- perl 5.12.3 built from source with '-des'
- Solaris 10 (SPARC)
- http proxy for http/ftp access to internet picked up successfully by FirstTime.pm from http_proxy/ftp_proxy.
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()
+'
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.