At 11:35 AM 6/5/01 -0500, you wrote:
>(sorry 'bout the duplicate - bad data)
>
>I'm using LWP to fetch an image and attempting to save it locally.
>The file is successfully created, however all it contains is:
>
>HTTP::Response=HASH(0x8380464)
>
>
>Here's the code snippet:
>
>  $file = "/home/images/$name";
>  open(IMAGE, ">$file") || die "unable to open filehandle $file \n";
>  $saveres = $ua->request(HTTP::Request->new(GET => $pic));
>  print IMAGE "$saveres";
>
>
>
>Can someone point me in the right direction to fixing this?
>Thanks!

Change last line to

print IMAGE $saveres->content;

You should be testing $saveres->is_success before opening the file, 
though.  perldoc lwpcook.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com

Reply via email to