Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: STDOUT redirect in Perl

by staeryatz (Monk)
on Nov 14, 2001 at 14:08 UTC ( [id://125280]=note: print w/replies, xml ) Need Help??


in reply to STDOUT redirect in Perl

Even more Temporarily, you can specify the filehandle with print, instead of using select.
open(OFILE, ">test.txt"); # make a filehandle print OFILE "this is a test.\n"; # print to filehandle
Using this way is good if you only have to print one time, instead of using 'select'. It is really not a good idea to change STDOUT, but rather just make a new filehandle like 'OFILE' shown above.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2024-04-23 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found