|There's more than one way to do things|
Split output to STDOUT as well as a fileby razmeth (Acolyte)
|on Jan 05, 2016 at 04:45 UTC||Need Help??|
razmeth has asked for the
wisdom of the Perl Monks concerning the following question:
I'm using Windows for this scripting, and I'd like to perform something which seems to be less simple than I'd expect.
I want to use a standard print command, and have the ouput printed to the screen as well as to a file. I do not need to modify STDERR, though that would be an added benefit, and I don't want to print to a specific function which then prints to multiple locations. Is this simpler than my time spent searching has implied?
<Some way to split the output>
print "Hello World!"
Desired output on screen:
Desired output in text file: