W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1997

Perl CGI and binary requests

From: Payam Mirrashidi <payam@cybernetic.triptonite.com>
Date: Wed, 15 Oct 1997 11:19:51 -0700
Message-ID: <34450946.A9244D15@cybernetic.triptonite.com>
To: www-jigsaw@w3.org
I've got some legacy Perl CGI scripts that I would like to
use with Jigsaw on windows but am having some problems. When I try
to return an image, say MIME type "image/jpeg", STDOUT
is getting closed when the first ^Z is sent across the stream.
I've tried setting binmode(STDOUT) but that doesn't seem
to be affecting it.

I'm still not convinced this is a Jigsaw problem but I'd to rule
that out. Is there something I can do to Jigsaw so that I know
that it will read in the entire stream using the Content-Length
header instead of doing partial read? I'm assuming this
is windows control Z weirdness and that there is some setting
somewhere that will fix this.

Here's a sample Perl script which tries to send a text stream
with a control Z embedded in it. The output from Jigsaw is:

CGI Test

====



binmode( STDOUT );

print <<EOM;
Content-Length: 117
Content-type: text/html

<html>
<head><title>CGI Test</title></head>
<body>
<h1>CGI Test</h1>
<pre>
EOM

printf STDOUT "====%c====\n",0032;

print <<EOM;
</pre>
</body>
</html>
EOM

close STDOUT;
Received on Wednesday, 15 October 1997 14:22:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:26 GMT