Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: get stdout stderr

by kennethk (Abbot)
on Oct 16, 2012 at 20:20 UTC ( #999419=note: print w/replies, xml ) Need Help??

in reply to get stdout stderr

I don't know if this is directly related to your issue and I've never worked with IO::CaptureOutput, but I've had difficulty shelling out in the past while capturing output to scalars. Detailed in STDOUT redirects and IPC::Open3, essentially the fileno of my output handles no longer corresponded to 0,1 and 2, and so the linking was lost on system call. The only solution I've found, assuming this is your issue, is rolling my own system call wrapper with pipe and fork, like in Re: How to capture child process output and divert to log4perl. In some cases, depending on some particulars, I've had to explicitly open unused filehandles to hold onto the right filenos until I needed them -- the system doles out filenos by the lowest one available.

Or all this could be off base for your case.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999419]
[shmem]: holli: all of our machinery is more perfect in its realm than any human being in theirs (Günther Anders), which doesn't mean not having fun, albeit dangerous sometimes.
[ww]: That's a big "if", holli.
[holli]: well the google car drove 5 times as far as the average human without an accident didnt it?
[ww]: Less than confident that ai+hardware is up (yet) to randomness and counterintuitive behavior on streets of NY

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (16)
As of 2017-11-21 13:16 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (301 votes). Check out past polls.