Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

How do I open another handle to STDOUT

by dmuz (Initiate)
on May 13, 2001 at 08:44 UTC ( [id://79995]=perlquestion: print w/replies, xml ) Need Help??

dmuz has asked for the wisdom of the Perl Monks concerning the following question:

How do I do this: $var=STDOUT; open(LOG,$var); print LOG;

Edit by tye

Replies are listed 'Best First'.
Re: How do I do this: code$var=STDOUT; open(LOG,$var); print LOG;/code
by japhy (Canon) on May 13, 2001 at 09:02 UTC
    I think you want:
    open DUP, ">&STDOUT"; print DUP "this goes to STDOUT, really\n"; close DUP;
Re: How do I open another handle to STDOUT
by dailylemma (Scribe) on May 13, 2001 at 16:09 UTC
    It seems that

    open( LOG, '>-'); print LOG;
    does the trick, although i'm not sure how to do
    this for a general filehadle.
Re: How do I open another handle to STDOUT
by lindex (Friar) on May 14, 2001 at 00:22 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-25 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found