perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randy J. Ray" <rj...@blackperl.com>
Subject IPC::Open3 and MP
Date Tue, 19 Jan 2010 22:11:37 GMT
I have some code that uses IPC::Open3, and I've discovered (the hard way)
that it doesn't work under MP2 and Apache 2.2.6. What is the "best
practices" way of doing this under MP2?

    eval {
        local $SIG{ALRM} = sub { die "alarm\n" };
        alarm 30; # 30 seconds is more than enough for bogofilter to run
        $child = open3($ichld, $ochld, undef, @cmd);
        print $ichld $param->{'message'}, "\n";
        close($ichld);
        @response = <$ochld>;
        waitpid $child, 0;
        alarm 0;
    };

I would prefer a solution that doesn't require adding a new CPAN module to
our dependencies list, but if that's the only way, then I'll do it. This has
to run in both MP2 and non-MP environments, so Apache::SubProcess probably
isn't going to help me...

Thanks in advance for any suggestions!

Randy
-- 
Randy J. Ray / randy.j.ray@gmail.com
Silicon Valley Scale Modelers: http://www.svsm.org
Sunnyvale, CA

Mime
View raw message