From the Image-Grab
page on cpan
my $url ='http://www.example.com/FileName.html'
my $pic = Image::Grab->new(SEARCH_URL=>$url,
my $File = basename($url);
$File =~ s/html/jpg/i;
# Now to save the image to disk
open(IMAGE, ">$File") || die"$File: $!";
binmode IMAGE; # for MSDOS derivations.
print IMAGE $pic->image;
I'm getting the error "Couldn't determine an absolute URL!" because the html page I'm searching uses upper case 'JPG' so the regex fails
How do I make the REGEX non case sensitive?
Also can you determine the File name of the image from the REGEX?
" my $File = $pic->name;" causes another error
Can't access `name' field in class Image::Grab