How is this script being called? Is it a CGI script, or is it being called in some kind of GUI? As I understand it, you can't just print an image to the command line as it's not a graphical interpreter, so you must be calling this in some other context. If this is in a CGI script, you would display the image as you would display any image in a web page:
my (@images) = query("SELECT name FROM test_file WHERE id='$id'");
foreach my $img(@images)
{
open(IMG,">$$tempfile.png") or die "Couldn't open $$tempfile.png: $!\n";
binmode IMG;
print IMG $img;
echo "<img src=\"$$tempfile\.png\">";
close IMG;
}
Can you give us any more details about how this script is being called/used?
roswell1329
Junior Poster in Training
71 posts since May 2006
Reputation Points: 21
Solved Threads: 2