Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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
Replies are listed 'Best First'.
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.
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.

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 scrutinizing the Monastery: (12)
As of 2015-07-08 07:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls