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.

==================
#!/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";


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


Quote:
> 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 perl.com web pages. Hope
this helps!

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

-- Tom Phoenix        http://www.teleport.com/~rootbeer/

Randal Schwartz Case:     http://www.lightlink.com/fors/



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. file_upload.pl in CGI.pm 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