Hi pals,
I want be sure, that download() return something, not undef, or empty
string, so snippet is:
my $content = download('http://www.perl.org');
sub download {
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->proxy(['http', 'https'] => $proxy) if $proxy;
my $resp = $ua->get(@_);
download(@_) unless $resp->content;
return $resp->content;
}
is this correct way ?
Thanks
-=x=-
Skontrolovan� antiv�rov�m programom NOD32
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>