in reply to Error displaying PNGs

You need to output HTTP headers indicating a proper Content-Type for a PNG image. Before the binmode, you want something like

print "Content-type: image/x-png\n\n";
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Replies are listed 'Best First'.
Wrong MIME type (was: Error displaying PNGs)
by Aristotle (Chancellor) on Mar 16, 2003 at 01:09 UTC
    The right MIME type is image/png though. All else will result in undefined behaviour, even if some browsers will work.

    Makeshifts last the longest.

      Thanks, Aristotle. I've long since lost my pointer to a list of valid content types. I posted what I last remembered seeing which was likely a long time ago before PNG files were popular.

      --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';