Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Reset STDERR to console

by moritz (Cardinal)
on Apr 01, 2011 at 10:11 UTC ( [id://896850]=note: print w/replies, xml ) Need Help??


in reply to Re: Reset STDERR to console
in thread Reset STDERR to console

As you'd know, by default, STDERR points to STDOUT.

Oh really?

$ perl -le 'print STDOUT foo' 1>/dev/null $ perl -le 'print STDERR foo' 1>/dev/null foo

So, not true.

The solution to the original question involves saving the old STDERR in a variable before reopening it. If I remember correctly, perlopentut talks about that.

Replies are listed 'Best First'.
Re^3: Reset STDERR to console
by anonymized user 468275 (Curate) on Apr 01, 2011 at 11:24 UTC
    It would have been accurate to say that the IO handles for STDERR and STDOUT are assigned to the same device rather than that one IO handle is assigned to the other.

    One world, one people

      Not really. STDOUT and STDERR default to be the same as the parent's STDOUT and STDERR respectively. There is no relation to devices.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found