Because you never defined $ua, so the proxy call doesn't do anything. LWP::Simple doesn't provide an interface to set the proxies in this manner, you need to do it by setting the $http_proxy environment variable instead...
#!/usr/bin/perl -w use strict; use LWP::Simple $env{http_proxy} = "http://myproxy:myport"; my $content = get("http://news.bbc.co.uk"); if($content) { print $content; } else { print "Error: Get stuffed"; }
We're not surrounded, we're in a target-rich environment! |
---|
In reply to Re: Re: Re: Re: Getting more out of LWP::Simple
by jasonk
in thread Getting more out of LWP::Simple
by Dog and Pony
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |