Works in Shell, not as cgi 
Author Message
 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.

require "";
use IPC::Open2;

$Maple = "/usr/local/bin/maple";

$pid = open2('OUTPUT','INPUT','/usr/local/bin/maple');

print INPUT "7!;\n";

print &PrintHeader;

while (<OUTPUT>){
print "<BR>$_";


print "</BODY>\n";
print "</HTML>\n";

Tue, 23 Nov 1999 03:00:00 GMT  
 Works in Shell, not as cgi

> Subject: Works in Shell, not as cgi

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the web pages. Hope
this helps!

-- Tom Phoenix

Randal Schwartz Case:

Tue, 23 Nov 1999 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Perl V4.036 on Solaris 2.3 Shell escapes do not work

2. DBI/DBD connection works in shell, not httpd

3. Scripts work from shell but not browser

4. Help, shell commands not working from within script

5. Suggestion for a checklist when calling an external UNIX executable from CGI does not work

6. ODBC not working as a CGI

7. in not working

8. cgi/pipes not working properly

9. perl cgi not working in windows 2000

10. Hashes of Hashes NOT working in CGI

11. Using alarm in Perl CGI script not working

12. system() command not wrking in cgi / works fine in .pl


Powered by phpBB® Forum Software