
Works in Shell, not as cgi
I'm trying to send input to Maple running on a UNIX Solaris machine and
want to pipe the output to a WEB page.
The Perl code below works from the Shell and returns Maple's standard
headers as well as the value of 7! - which is the input in this case.
However, when run via a cgi call from the browser, Maple's header
information gets retuned but NOT the value of 7!
I assume it's a buffering problem of some kind - but WHAT?
I've tried selecting handles and setting $| =1 on them but to no avail.
Any suggestions???
BTW we are using Apache if that's significant.
==================
#!/usr/local/bin/perl
require "cgi-lib.pl";
use IPC::Open2;
$|=1;
$Maple = "/usr/local/bin/maple";
$pid = open2('OUTPUT','INPUT','/usr/local/bin/maple');
print INPUT "7!;\n";
print &PrintHeader;
print "<HTML><HEAD><TITLE>TESTING</TITLE></HEAD><BODY>\n";
while (<OUTPUT>){
print "<BR>$_";
Quote:
}
print "</BODY>\n";
print "</HTML>\n";