gideondsouza has asked for the wisdom of the Perl Monks concerning the following question:
I'm a perl newbie and maybe I'm just doing this incorrectly.
I'm trying to download an image from some url into my server on amazon ec2. I then want to use Imager to load that file up. For the life of me I cannot understand why it is always undef!!. This is the code:
my $data = LWP::Simple::get($the_url); my $fh = File::Temp->new(); my $filename = $fh->filename; binmode ($fh); print $fh $data; #### img is ALWAYS undef! my $img = Imager->new(file => $filename, type => 'png'); close ($fh);
Am I doing this correctly? Any clues as to what I should be looking for?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: downloading an image from external server returns null always (error checking)
by Anonymous Monk on Mar 09, 2013 at 08:47 UTC | |
|
Re: downloading an image from external server returns null always
by choroba (Cardinal) on Mar 09, 2013 at 08:42 UTC | |
|
Re: downloading an image from external server returns null always
by gideondsouza (Pilgrim) on Mar 09, 2013 at 09:16 UTC |