in reply to showing an image downloaded with LWP::Simple

It doesn't work for the same reason "cat image.gif" doesn't work: you can't just print a binary file format to the terminal and expect it to show an image.

Just send the file data to some program that will display the graphics, for instance, if you have image-magick's display program installed:

use LWP::Simple; open CMD,"|display -" or die "Can't fork display program: $!"; print CMD get("http://www.nhc.noaa.gov/storm_graphics/AT06/refresh/AL0 +606W5+gif/144631W_sm.gif"); close CMD;

Replies are listed 'Best First'.
Re^2: showing an image downloaded with LWP::Simple
by Anonymous Monk on Sep 08, 2006 at 18:32 UTC
    How come Internet Explorer cannot view the image? Thanks for your help.
        Thanks again for your assistance. Here is the code below:

        #!/usr/local/bin/perl #Warn browser that HTML is coming print "Content-type: text/html\n\n"; print header; print STDOUT "<html>\n<head>\n"; print STDOUT "<title></title>\n"; print STDOUT "</head>\n"; print STDOUT "<body>\n"; use LWP::Simple; print $content = get("http://www.nhc.noaa.gov/storm_graphics/AT06/refr +esh/AL0606W5+gif/144631W_sm.gif"); print STDOUT "</body>\n"; print STDOUT "</html>\n";

        Basically, I just want to display the image when I go to the link.

        Edit: g0n - code tags