1834676 Members
2315 Online
110069 Solutions
New Discussion

apache2.0.43 and perl

 
SOLVED
Go to solution
Josef Jirkovsky
Occasional Advisor

apache2.0.43 and perl

Hello,
I installed hpapache 2.0.43 on an HPUX 11.0 with
perl 5.6.1
I am calling within a HTML page a perl script like:


Within this script i have the instruction:
$input = ;
with trace before and after.
With this instruction the script hangs and
"/opt/hpapache2/bin/apachectl stop" interrupts and get it executed until the end. Without this instrution
all is executed normally.

Did i miss something, or shall i look into my perl
installation (it's not the standard HP one).

Thanks
josef
6 REPLIES 6
Ron Kinner
Honored Contributor
Solution

Re: apache2.0.43 and perl

$input = ;

Says to stop and wait until you get something from the user who is generally expected to be sitting at the console. It is not clear to me how an HTML page is supposed to communicate with the console. Have you redirected STDIN somehow?

There are two scripts on the following page which might come in handy for your application:

http://www.perl.com/CPAN/scripts/CGI/index.html

CGIscripter and cgi-reflect.

Ron
Josef Jirkovsky
Occasional Advisor

Re: apache2.0.43 and perl

Thanks Ron,

i downloaded the script "cgi-reflect-1.6.pl" and put it
in place of mine.
What i am getting, is the following error:
"Error reading STDIN - ALRM! at cgi-reflect.pl line 78"
It seems that i really have a problem reading the
STDIN - is it possible that i misconfigured something in Apache?

Actually i exclude perl6.5.1 to be the problem. I installed
the HP distribution of perl 5.6.1 and i have the same problem.

josef
Ralph Grothe
Honored Contributor

Re: apache2.0.43 and perl

Looks like your CGI script triggered an alarm.
That's the idiom how one usually sets up timers in Perl by defining a signal handler that catches a SIGALRM.
The SIGALRM is then deliberately raised in an eval {} block through alarm() if a specified period has passed.
It looks as if your CGI script expeted data to be read from the special file handle STDIN where nothing was supplied.

I also wonder why one should do this in a CGI script, because the script is executed by the webserver.
The usual way to supply user input to a CGI script is trhough a form which is sent by the webserver to the client's browser.
The user then would have to fill out this form and press a submit button.
Thereon the webserver executes the script/program that is referred to by the ACTION attribute of the FORM tag.
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: apache2.0.43 and perl

Looks like your CGI script triggered an alarm.
That's the idiom how one usually sets up timers in Perl by defining a signal handler that catches a SIGALRM.
The SIGALRM is then deliberately raised in an eval {} block through alarm() if a specified period has passed.
It looks as if your CGI script expeted data to be read from the special file handle STDIN where nothing was supplied.

I also wonder why one should do this in a CGI script, because the script is executed on by the webserver.
The usual way to supply user input to a CGI script is trhough a form which is sent by the webserver to the client's browser.
The user then would have to fill out this form and press a submit button.
Thereon the webserver executes the script/program that is referred to by the ACTION attribute of the FORM tag.
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: apache2.0.43 and perl

Looks like your CGI script triggered an alarm.
That's the idiom how one usually sets up timers in Perl by defining a signal han
dler that catches a SIGALRM.
The SIGALRM is then deliberately raised in an eval {} block through alarm() if a
specified period has passed.
It looks as if your CGI script expeted data to be read from the special file han
dle STDIN where nothing was supplied.

I also wonder why one should do this in a CGI script, because the script is exec
uted by the webserver.
The usual way to supply user input to a CGI script is trhough a form which is se
nt by the webserver to the client's browser.
The user then would have to fill out this form and press a submit button.
Thereon the webserver executes the script/program that is referred to by the ACT
ION attribute of the FORM tag.
Madness, thy name is system administration
Josef Jirkovsky
Occasional Advisor

Re: apache2.0.43 and perl

Thanks for your answers,

Finally i have rewritten my old script
$buffer = (worked under perl 5.0.4 and apache 1.3.4)

to

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

and it worked fine with perl 5.6.1.

josef