in reply to Re: Redirecting STDOUT to file and screen as an afterthought, on Windows.
in thread Redirecting STDOUT to file and screen as an afterthought, on Windows.

How would you do that if the user turns the log_to_file switch on, does some stuff, then turns the log_to_file switch off?

You'd have to duplicate every print command, like this:

if ($tee) { print $tee "What did I want to say?\n" } else { print "What did I want to say?\n" }
  • Comment on Re^2: Redirecting STDOUT to file and screen as an afterthought, on Windows.
  • Download Code

Replies are listed 'Best First'.
Re^3: Redirecting STDOUT to file and screen as an afterthought, on Windows.
by spikey_wan (Scribe) on Nov 04, 2004 at 13:54 UTC