Subject: | Issue with IPC::Open3 - Not a GLOB reference at /usr/lib/perl5/FCGI.pm line 125 |
Hi,
I'm receiving the following error if I try to execute system calls with IPC::Open3:
"Not a GLOB reference at /usr/lib/perl5/FCGI.pm line 125"
My setup to reproduce the error is very simple.
Nginx config:
location / {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9005;
}
The Perl script:
#!/usr/bin/perl
use strict;
use warnings;
use FCGI;
use IPC::Open3;
use Symbol;
my $socket = FCGI::OpenSocket(":9005", 10);
my $request = FCGI::Request(
\*STDIN, \*STDOUT, \*STDERR, \%ENV,
$socket, &FCGI::FAIL_ACCEPT_ON_INTR
);
while($request->Accept() >= 0) {
my ($in, $out, $err) = (gensym, gensym, gensym);
my $pid = open3($in, $out, $err, "date")
or die "unable to execute 'date' - $!";
close $in;
my $content = do { local $/; <$out> };
close $out;
close $err;
waitpid($pid, 0);
print "Content-type: text/plain\r\n\r\n";
print $content;
}
I'm running IPC::Open3 v1.09, Perl 5.14 and FCGI v0.74.
Is that a bug in FCGI or am I doing something wrong?
Cheers,
Jonny