http://qs321.pair.com?node_id=559264

ant has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
Its been a while.
Here's a snippet of my code
print header(); if ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $input, $ENV{'CONTENT_LENGTH'}) || print "could not e +xecute query <br>"; print "got into POST - $input $ENV{'CONTENT_LENGTH'} <br>" . <STDI +N>; @pairs = split(/&/, $input); }
The output is 'could not execute query '
howvever, when I replace print header with  print "Content-type: text/html","\r\n\r\n"; it all works fine. It seems with print header the STDIN cannot read the HTML form. Below this code, the HTML is formed with the form tag and method = 'post'.
Any ideas why this way worked would be great.
Cheers
Ant