what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server?

K

kath

Hi all,

I have small doubt, the following code works fine in Apache server.
But not completely in Tomcat. Why??
------------------------
#!C:\Perl\bin\perl.exe

# hello.pl

use CGI;
$cgi = new CGI;
print $cgi->header;
printf "Hello world";
system("perl Hi.pl");
------------------------
#!C:\Perl\bin\perl.exe

# hi.pl

print "Hi";
------------------------

When I tried in Tomcat, the script prints only
Hello world

Why?
What's wrong?


kath.
 
G

Gunnar Hjalmarsson

kath said:
I have small doubt, the following code works fine in Apache server.
But not completely in Tomcat. Why??

<snip>

Why don't you ask Perl
system("perl Hi.pl");

system("perl Hi.pl") == 0 or die $!;

and check the server's error log?
 
J

J. Gleixner

kath said:
Hi all,

I have small doubt, the following code works fine in Apache server.
But not completely in Tomcat. Why??
------------------------
#!C:\Perl\bin\perl.exe

# hello.pl

use CGI;
$cgi = new CGI;
print $cgi->header;
printf "Hello world";
system("perl Hi.pl");
------------------------
#!C:\Perl\bin\perl.exe

# hi.pl

print "Hi";
------------------------

When I tried in Tomcat, the script prints only
Hello world

Why?
What's wrong?

perldoc -q "Why can't I get the output of a command with system"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top