http://www.perlmonks.org?node_id=737473


in reply to How do i save an image with www::mechanize

Grab the html:
my $mech = WWW::Mechanize->new(); $mech->get($add); my $r = $mech->content;
perform a regex on $r to extract the url of the image, and then use either use Image::Magick or GD to save the image on your server.
$r =~ m#regex(.*)# my $imgurl = $1; my ($image, $x); my $photofile ="photo.jpg; $image = Image::Magick->new; $x = $image->Read($imgurl); $x = $image->Write("$photofile");