Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
... use LWP::Simple; use HTML::TokeParser; use CGI::Carp; my ($image, $image_dir, $image_url, $new_image); print "Content-type: text/html\n\n"; $image_dir = "../../store_here"; # $image should contain GIF data after this. $image_url = "http://www.dimages/image_sample.gif" unless $url =~ m{^h +ttp://}; $image = get($image_url) || ''; ###### # Save copy of image open(OUTPUT_IMG_FILE, ">$image_dir") || die "Unable to open $image_dir +: $!"; binmode(OUTPUT_IMG_FILE); print OUTPUT_IMG_FILE $image; close(OUTPUT_IMG_FILE); ######
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grabbing Specific Image
by merlyn (Sage) on May 01, 2007 at 16:46 UTC | |
by Anonymous Monk on May 01, 2007 at 17:08 UTC | |
by merlyn (Sage) on May 01, 2007 at 17:09 UTC | |
by bart (Canon) on May 02, 2007 at 13:48 UTC | |
|
Re: Grabbing Specific Image
by Joost (Canon) on May 01, 2007 at 16:03 UTC | |
|
Re: Grabbing Specific Image
by Albannach (Monsignor) on May 01, 2007 at 16:07 UTC | |
|
Re: Grabbing Specific Image
by akho (Hermit) on May 01, 2007 at 16:03 UTC | |
by Anonymous Monk on May 01, 2007 at 16:05 UTC |