in reply to Re^2: STDIN from CGI object
in thread STDIN from CGI object

Maybe like this
SaveStdin('newfile'); open STDIN, '<', 'newfile'; $q = CGI->new;

Replies are listed 'Best First'.
Re^4: STDIN from CGI object
by vit (Friar) on Feb 19, 2011 at 17:39 UTC
    Thanks,
    Is it possible to avoid literally writing to a file?
      Is it possible to avoid literally writing to a file?

      If this approach works, it should be possible. See the documentation for open, or IO::Scalar/IO::String

        Yes it works. Would it be correct to do it through | this way:
        my $stdin_str = ""; read (STDIN, $stdin_str, $ENV{'CONTENT_LENGTH'}); open FH, ">|" or die $!; print FH $stdin_str; open STDIN, "<|" or die $!; my $q = new CGI; close STDIN; close FH;