H
Hal Vaughan
I thought this was a FAQ, but I can't find it, which means it either isn't
as obvious as I think or I'm just using the wrong search terms.
I want to be able to print to either STDOUT or to a file, so if I have a
series of print statements like:
print $fh "This is a line of text\n";
I'd like to be able to have $fh be able to refer to STDOUT so a command line
option for my program could specify to either save the output to a file or
print it to the console. I know I can just open the file, but how to I set
$fh equal to the actual STDOUT stream?
Thanks!
Hal
as obvious as I think or I'm just using the wrong search terms.
I want to be able to print to either STDOUT or to a file, so if I have a
series of print statements like:
print $fh "This is a line of text\n";
I'd like to be able to have $fh be able to refer to STDOUT so a command line
option for my program could specify to either save the output to a file or
print it to the console. I know I can just open the file, but how to I set
$fh equal to the actual STDOUT stream?
Thanks!
Hal