Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Messin around with fork() and fd's

by wog (Curate)
on Oct 29, 2001 at 00:49 UTC ( #121846=note: print w/replies, xml ) Need Help??


in reply to Messin around with fork() and fd's

Redirecting a filehandle is easy especially if you don't care about restoring it later:

open STDOUT, ">>somelogfile" or die "opening logfile: $!\n"; open STDERR, ">&STDOUT" or die "dup'ing STDOUT to STDERR: $!\n";

Basically, this is the same as example of redirecting STDOUT and STDERR in the docs for open except you don't actually save the filehandles beforehand and restore them afterwards.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (1)
As of 2022-11-26 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?