in reply to Re: WHy error message is printed in STDOUT?
in thread WHy error message is printed in STDOUT?

Perhaps I'm being stupid but it looks to me like the message is going to STDOUT because print has been used rather than warn or print STDERR. Feel free to tell me I am stupid if I have missed something obvious.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^3: WHy error message is printed in STDOUT?
by PreferredUserName (Pilgrim) on Apr 12, 2006 at 13:55 UTC
    The command in the backticks, not your script, is the thing printing to stderr.

    In Unix, you could capture the stderr by redirecting stderr to also go to stdout, like this:

    $output = `$cmd 2>&1`
    That says "put the stuff going to file descriptor 2 (stderr) into file descriptor 1 (stdout)".

    I'm not sure how all that works on Windows.

      You forgot to tell me I'm stupid! I think this is known as "can't see the wood for the trees" syndrome.

      Oh dear!

      JohnGG