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

Thanks,
Is it possible to avoid literally writing to a file?

Replies are listed 'Best First'.
Re^5: STDIN from CGI object
by Anonymous Monk on Feb 19, 2011 at 23:47 UTC
    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;
        Try it. I rarely use |, but it doesn't look like it would work to me , which is why I recommended opening to a scalar