[Biodevelopers] WWWBLAST: blast.REAL process can't read param
values from parent process
Malay
mbasu at mail.nih.gov
Fri Apr 16 12:52:42 EDT 2004
Hancy Frederic wrote:
> Hi Malay,
>
> Thanks for your suggestion with @ARGV, I've tried it but it didn't work in a
> first place. I've tried to read directly from STDIN without any success:
>
> my $query;
> if ($ENV{REQUEST_METHOD} eq 'POST') {
> read (STDIN, $query, $ENV{CONTENT_LENGTH});
> print $query;
> }
>
> From what I understand of CGI, when the web server receives an HTTP request,
> it reads the HTTP headers and passes the content body of the message to the
> CGI script on STDIN (cf. O'Reilly's CGI prog.). STDIN is empty for a GET
> request (no body), and should contain the encoded form data in the case of a
> POST request. The content-length header is used for reading the right amount
> of bytes from the content body of the POST request.
>
> So why can I access to my param values through the CGI.pm object, but not
> through STDIN? Well, the answer (after a week of struggle) is rather
> trivial: you can't do both! If you instantiate a cgi object, it reads all
> the data from STDIN, but nothing else seems to be available when running a
> command.
Yes. Right. Your CGI wrapper will get the input from STDIN but there is
no reason why it can't call a child program with commad line argument.
"@ARGV" in my code was actually argument passed to the child process. If
you are calling the "exec" from a CGI wrapper then @ARGV will be
undefined. You need to set these arguments and called the child program
with the command line params.
Malay
More information about the Biodevelopers
mailing list