good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Split output to STDOUT as well as a fileby razmeth (Acolyte) |
on Jan 05, 2016 at 04:45 UTC ( [id://1151910]=perlquestion: print w/replies, xml ) | 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? Desired code: <Some way to split the output> print "Hello World!" Desired output on screen: Hello World! Desired output in text file: Hello World!
Back to
Seekers of Perl Wisdom
|
|