I want to have a CGI script return a simple 1x1 transparent gif. However, I wanted to avoid opening the gif file, reading the contents, printing the contents and then closing the file.
I tried this (on a windows nt box), but it didn't work:
print "Content-type: image/gif\n\n";
binmode(STDOUT);
print 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80
+, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0
+x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00
+, 0x3B;
The print statement is the hex representation of a 1x1 transparent gif file. Why didn't this work and is there something similar I can do?
Many thanks,
meraxes