* httpd/OSF/perl/CGI stdin pipe problem
@ 1995-09-16 4:00 Hugh Messenger
1995-09-18 4:00 ` Rainer Schoepf
0 siblings, 1 reply; 2+ messages in thread
From: Hugh Messenger @ 1995-09-16 4:00 UTC (permalink / raw)
I'm running Apache 0.6.5 (a flavour of httpd 1.4.x) on an Alpha/OSF box.
I'm having a bizarre problem with piping the output of commands into perl
CGI scripts. For instance ...
open (SWISH, "/web/swish/swish -w foo bar -f /web/swish/sources/index.swish |";
while (<SWISH>) {
print;
}
This code chunkette works fine if run by hand from a shell. As soon as I
try and run it inside a CGI script (using the GET method to provide the
search criteria for swish), the output simply never shows up. If I
replace the call to 'swish' with some random built in system command (like
'w'), it works fine. It just refuses to work with anything but
shell/system commands.
I'm running with perl5.001, but have tried 4.x and 5.000 as well.
Ay Suggestions Gratefully Accepted.
-- hugh
PS - I've already fixed the generic CGI/cmd fork/exec/sleep problem, so it
ain't that, although I suspect the problem may be of similar origin.
--
| Hugh Messenger - VP and Systems Manager - Net Results, Inc. |
| hippo@garply.com - http://www.garply.com/garply/staff/hippo |
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: httpd/OSF/perl/CGI stdin pipe problem
1995-09-16 4:00 httpd/OSF/perl/CGI stdin pipe problem Hugh Messenger
@ 1995-09-18 4:00 ` Rainer Schoepf
0 siblings, 0 replies; 2+ messages in thread
From: Rainer Schoepf @ 1995-09-18 4:00 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
In article <hippo-1609951223040001@cerebus.garply.com> hippo@garply.com (Hugh Messenger) writes:
I'm running Apache 0.6.5 (a flavour of httpd 1.4.x) on an Alpha/OSF box.
I'm having a bizarre problem with piping the output of commands into perl
CGI scripts. For instance ...
open (SWISH, "/web/swish/swish -w foo bar -f /web/swish/sources/index.swish |";
while (<SWISH>) {
print;
}
This code chunkette works fine if run by hand from a shell. As soon as I
try and run it inside a CGI script (using the GET method to provide the
search criteria for swish), the output simply never shows up. If I
replace the call to 'swish' with some random built in system command (like
'w'), it works fine. It just refuses to work with anything but
shell/system commands.
I'm running with perl5.001, but have tried 4.x and 5.000 as well.
I've seen the same problem with the CERN httpd. If I added a second
print command that ships to a file as well, that would always contain
the output.
Try setting output to unbuffered, ie.
$| = 1;
I don't entirely understand what is going on here, but there seems to
be a problem with non-blocking read from a pipe within the http server.
--
Rainer Sch�pf
Zentrum f�r Datenverarbeitung A point of view can be a dangerous
der Universit�t Mainz luxury when substituted for insight
Anselm-Franz-von-Bentzel-Weg 12 and understanding.
D-55099 Mainz
Germany Herbert Marshall McLuhan:
<Schoepf@Uni-Mainz.DE> The Gutenberg Galaxy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-09-18 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-09-16 4:00 httpd/OSF/perl/CGI stdin pipe problem Hugh Messenger
1995-09-18 4:00 ` Rainer Schoepf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox