- There shall NEVER be an else after a return/exit/croak/die! NEVER!
- You call wget from a composed string. If the $url has " in there (or worse, a ; followed by a command as haukex poited out in Re: wget not working from perl), quotation as you use it might fail:
my $COMMAND = "wget -q -O $FILENAME $URL";
print `$COMMAND`;
--->
open my $sh, "-|", "wget", "-q", "-O", $FILENAME, $URL;
print <$sh>;
close $sh;
is much safer.
- Why do you use all those capitalized variable names?
- Why use a shell escape anyway?
use LWP::Simple;
is_success (getprint ($URL)) or warn "Fetch failed";
Enjoy, Have FUN! H.Merijn