[Catalyst] Chart::Graph::Gnuplot trouble.

Peter Edwards peter at dragonstaff.com
Thu Mar 20 22:53:11 GMT 2008


From: Bruce J Keeler [mailto:bruce at drangle.com] 
>>Gene Selkov wrote:
>> But I would also like a competent answer to this question: what can be 
>> done to make the "normal" Catalyst code interact with unix processes 
>> on all 3 channels? I mean, all 3: if a process spews something on 
>> stderr, I'd like to capture that, consider how severe the message is 
>> (unless it tells me in the status code) and possibly throw an 
>> exception and ultimately forward the message to the browser.
>>
>If system() is broke, there are other alternatives.  Check out IPC::Open3,
and perldoc perlipc.  You'll need to block SIGPIPE, and deal with reaping
the zombie properly after the process exits.  The Perl cookbook may have
some good info too.  If you really want to understand the ins and outs of
UNIX programming, read the Richard Stevens books.

Yeah, I already tried using fork(), setpgrp(), setsid() and reopening stdin,
stdout, stderr and still couldn't get back a correct exit status, that's
when I used IPC::Run which (sorta) worked although its internal status
reporting gets broken by Catalyst::Engine::HTTP.
I came up with a workaround so the code would work under both mod_perl and
the test server but it's hacky.
I need to test whether using ptys improves the behaviour.

Regards, Peter




More information about the Catalyst mailing list