From: Bruce J Keeler [mailto:[EMAIL PROTECTED] >>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 _______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
