Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: IPC::Open3 misbehaving when STDOUT is not FD #1

by Khen1950fx (Canon)
on Jun 05, 2009 at 20:35 UTC ( #768921=note: print w/ replies, xml ) Need Help??


in reply to IPC::Open3 misbehaving when STDOUT is not FD #1

printf "out 1\\nout 2\\nout 3\\n" >&2 will give you the desired output.

Update: While the answer is true, "true" here means "error". Bash is running printf, not perl, so Bash is running into or and die and returning or: command not found and die: command not found; hence, eveything goes to stderr.


Comment on Re: IPC::Open3 misbehaving when STDOUT is not FD #1
Select or Download Code
Re^2: IPC::Open3 misbehaving when STDOUT is not FD #1
by ikegami (Pope) on Jun 05, 2009 at 20:46 UTC
    So will
    #!/usr/bin/perl print <<'__EOI__'; PIPE: out 1 PIPE: out 2 PIPE: out 3 PIPE: err 1 PIPE: err 2 PIPE: err 3 __EOI__

    True, but completely unhelpful.

    I posted my comments to the OP in RT.

Re^2: IPC::Open3 misbehaving when STDOUT is not FD #1
by sgifford (Prior) on Jun 05, 2009 at 22:11 UTC
    True Khen1950fx, that may be a good workaround. I will see if it works in my environment (it will depend on whether STDERR is set to a file descriptor other than 2, which fails in a similar way). If it does it will be easier to support than a patched IPC::Open3.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://768921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-07-25 02:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls