in reply to retrieving JPG file with LWP and WWW:Mechanize

You want to use binmode before writing your file. But maybe you want to make LWP::UserAgent do all the work by doing the following instead:

$bot->get($url, ':content_file' => "image$x.jpg");

This will directly save the image to disk without further action on your part needed.

Replies are listed 'Best First'.
Re^2: retrieving JPG file with LWP and WWW:Mechanize
by bfdi533 (Friar) on Dec 26, 2006 at 17:44 UTC
    I guess it is back to the manual to see how I missed this.

    I will probably do the binmode option since the code is already written but will definitely remember this little trick in the future.