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

<head><title>CGI Test</title></head>
<h1>CGI Test</h1>

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

print <<EOM;

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:41:23 UTC