In a perl apache module that I'm writing, I wanted to try to parse the
content of a POST myself.  According to "Writing Apache Modules with Perl
and C", page 438, you should be able to read the content from STDIN using
Perl's read() and getc(), and using Perl's <> file operations.

When I use the <STDIN> statement, I get a single line that contains the
entire POST content, rather than just the first line of the post.  Can
anyone think of why that would happen?  Here's the snippet of my code:

$line = <STDIN>;
$r->print("$line\n");

In my response, I get the entire POST content echoed back to me, where I
only expected the first line.  If I comment out the "print" statement, I
don't get anything echoed back (which is what I would expect).  It really
looks like $line contains the entire content.

Any clues?

-jse

Reply via email to