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

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

by pwesthagen (Initiate)
on Apr 04, 2012 at 22:52 UTC ( #963548=categorized answer: print w/replies, xml ) Need Help??

Q&A > input and output > how do i redirect STDOUT, STDIN, or STDERR to a FILE? - Answer contributed by pwesthagen

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
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-06-28 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (638 votes). Check out past polls.