in reply to download JPG series with error-handling

If you're just getting the response and printing it, you might want to consider using LWP::Simple's mirror functions. It'll handle writing your file to disk, and return you the response code too...
my $res_code = mirror('http://www.yadaa.com/file.jpg', './file.jgp');