in reply to Re: perl, open and pipe
in thread perl, open and pipe

Depending on what /usr/bin/js does, that might be a bad idea. 2>&1 mixes STDERR and STDOUT into a single stream, so you may have a hard time "unmixing" them. If you need both STDOUT and STDERR, don't use open "...2>&1 |", but create two pipes manually or using IPC::Open3. If you need only STDOUT, use open "... 2> /dev/null |", if you need only STDERR, use open "... 2>&1 > /dev/null |".

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^3: perl, open and pipe
by shmem (Chancellor) on May 11, 2010 at 07:48 UTC
    Since in the OP 'twas said
    I want to catch that error (or any result from the /usr/bin/js program).

    a single stream fits the task. Managing two file descriptors would be a YAGNI in that case.