Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: how do i redirect STDOUT, STDIN, or STDERR to a FILE?

by pwesthagen (Initiate)
on Apr 04, 2012 at 22:52 UTC ( [id://963548]=note: print w/replies, xml ) Need Help??


in reply to how do i redirect STDOUT, STDIN, or STDERR to a FILE?

Try this, worked for me:
open FILE, ">$file"; select FILE; # print will use FILE instead of STDOUT print "Hello, world!"; # goes to FILE select STDOUT; # back to normal print "Goodbye."; # goes to STDOUT

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found