in reply to Re: STDIN not working, STDIN hanging
in thread STDIN not working, STDIN hanging

2010-07-01

Your example worked,

and when I replaced,

read STDIN, $query, $ENV{CONTENT_LENGTH}; # <--

with,

$query=<STDIN>; # <--

it also worked, only when it was loaded directly, but when a form was sent to it, it did the continuous load.

Works when loaded directly,
Continuous when form sent to it...

#! perl my $query; my $req_method = $ENV{REQUEST_METHOD}; if ($req_method eq 'POST') { $query=<STDIN>; print $query; # <-- } # END

Works when loaded directly,
Continuous when form sent to it...

#! perl my $query; if ($ENV{REQUEST_METHOD} eq 'POST') { $query=<STDIN>; print $query; # <-- } # END

One question is, why did it not work before, when the form was method="post" --

Your response indicates that <STDIN> handles POST...

if ($req_method eq 'POST') {$query=<STDIN>;}

and $ENV{QUERY_STRING} handles GET...

elsif ($req_method eq 'GET') {$query = $ENV{QUERY_STRING};}

Did it have anything to do with sockets as the previous response indicates ?

(But it's not recommended...)

Why is it not recommended ?

- Look For God