When you create a new CGI object CGI.pm will read 'CONTENT_LENGTH' bytes from STDIN so the buffer will inevitably be empty as you have already read 'CONTENT_LENGTH' bytes from STDIN when you made your new CGI object. To check you are actually getting data just run this script (less is more):
#!/usr/bin/perl read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); print "Content-type: text/plain\n\n$buffer"
If you find that this proves that data is getting to your script on STDIN have a look at what is in the CGI object like this:
#!/usr/bin/perl use Data:Dumper; use CGI; $q = new CGI; print $q->header; print '<pre>'.$q->escapeHTML(Dumper($q)).'</pre>';
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Bizarre CGI.pm behaviour or just me?
by tachyon
in thread Bizarre CGI.pm behaviour or just me?
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |