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

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

Replies are listed 'Best First'.
Re^6: STDIN from CGI object
by vit (Friar) on Feb 20, 2011 at 19:51 UTC
    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