On Fri, 8 Jun 2001, Rodney Broom wrote:
> OK, here's what the solution was. According to Doug in a posting that I
> found in an archive search, mod_perl's STDIN is really just a Perl glob, and
> not a file handle. So instead of reading from it (and thereby emptying the
> file handle named STDIN so that CGI and other things can't get this data),
> now I simply assign from it:
*{"STDIN"} is a Perl glob. STDIN is a Perl IO 'handle', which is normally
used to access C's stdio stdin FILE pointer. under mod_perl, the STDIN
handle is tied to the Apache request_rec, rather than stdio stdin.
i never said anything about using the $STDIN scalar. $STDIN is just like
any other global variable, except that it aliased to $main::STDIN no
matter what package you reference it from. $STDIN != STDIN
> if ($first_pass) {
> print TEMP_FILE, $STDIN;
this will only work if you first read(STDIN, $STDIN, $content_length);
otherwise, you're getting the global value from the previous request,
since $STDIN is not reset. and again is no different from using a global
such as $Foo::PostData, other than the aliasing mentioned above.