I like the idea of verifying the file format. You could use Image::Size to check for pictures. And maybe you need the filesize for the HTML-img-Tag (width and height).
Also I would open the OUTFILE right before the PRINT-statement. If the picture is not valid you end in having created a zero-length file.
Good bye, Uwe
Comment on Re: Re: LWP to download images, how to let LWP decide, wether it is an image or not?