You can't read from STDIN once it's been read from. You can't go backwards in it. So save it!
BEGIN { pipe local (*IN, *OUT); while (<STDIN>) { print OUT; # do what you need to with $_ } close OUT; open STDIN, "<&IN"; } use CGI;

Replies are listed 'Best First'.
(tye)Re: Save STDIN from CGI.pm
by tye (Sage) on Sep 10, 2001 at 21:20 UTC

    This hangs if the data on STDIN is bigger than your system's pipe buffer, so I wouldn't recommend it.

            - tye (but my friends call me "Tye")