use strict;
use LWP::Simple qw/getstore/;
my $site = getstore('http://www.google.com',
'test.html');
# Or you could store the content in a scalar, with:
# my $content = get('http://www.google.com');
####
use strict;
use HTML::SimpleLinkExtor;
my $extract = HTML::SimpleLinkExtor->new();
$extract->parse_file("test.html");
# or you could use $extract->parse($content), as shown
# above, using the raw HTML
my @images = $extract->img;
# feed each element of @images back to a getstore() for
# each image found
####
$file =~ s/.*[\/\\](.*)/$1/;