Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Forcing to ignore LWP/Net::FTP and use wget/lynx etc

by aufflick (Deacon)
on Sep 28, 2004 at 23:01 UTC ( #394785=note: print w/replies, xml ) Need Help??

in reply to Forcing to ignore LWP/Net::FTP and use wget/lynx etc

In the words of the current Australian Guinness advertising campain:


I slightly modified the solution by PodMaster to make my own executable script:

#!/usr/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::shell();
Only wget will work through this proxy, because it virus scans the download and does an http redirect for your "browser" to download the binary. wget is smart enough to follow this convoluted journey.

To skip lynx and the other command line tools, I hacked my in ~/.cpan/CPAN to say something like:

'ncftpget' => q[/bin/false], 'ftp' => q[/bin/false], 'lynx' => q[/bin/false],
Hey - it works.

Also note that you can set your proxy config in like so:
'http_proxy' => q[], 'proxy_pass' => q[myPassWord], 'proxy_user' => q[myUser],
Thankyou all.

Replies are listed 'Best First'.
Re^2: Forcing to ignore LWP/Net::FTP and use wget/lynx etc
by aufflick (Deacon) on Sep 28, 2004 at 23:10 UTC
    Minor addition to script to avoid an annoying warning:
    use CPAN (); $CPAN_has_usable = \&CPAN::has_usable; local *CPAN::has_usable = sub { return if $_[1] =~ /^(?:Net|LWP)/; return $CPAN_has_usable->( @_ ); }; $ENV{PERL_READLINE_NOWARN} = 1; CPAN::shell();
    It seems that if the shell is started this way rather than directly on the commandline, it complains "Can't ioctl TIOCGETP: Invalid argument" - readline etc. work anyway, so the env variable disables the warning.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://394785]
[GotToBTru]: "I did it my $way"
[JohnCub]: I hope $way isn't a hashref. ;)
[GotToBTru]: many times i've been told I made a real hash of thiings
[GotToBTru]: so .. perhaps it should b e
[thepkd]: Just wondering why $aohoaoh[0]->{'foo '}[0]->{'bar'} would be difficult to read and understand?
[thepkd]: I am a noob and find it easier

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2016-12-06 13:51 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (105 votes). Check out past polls.