when cgi script read data, posted from html form with "post" post method, the read sub return zero of readed bytes, but $ENV{'CONTENT_LENGTH'} hold (for example) 7 bytes.
Any idea? Where I'm wrong ?
Here is my html from and cgi script:
=========================== some_file.html ---------------------------============================== ================================ script.pl: -------------------------------- #!/usr/bin/perl use CGI qw/:standard/; print header; $length = $ENV{'CONTENT_LENGTH'}; $count = read (STDIN, $buffer, $length); print "readed actually: $count, length: $length"; ================================ output in browser:
Yes, I may solve this problem when getting form input touch CGI.pm, but the code above is correct, isn't it?
Edit by [tye], remove PRE tags, other formatting clean-up
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
perlmonks.org content © perlmonks.org and merlyn, stan2004
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03