in reply to changing STDOUT
You should always constrain your variables to a scope as small as possible. Typically, one would use my, but globs require the use of local. Had you done this here, STDOUT would have restored itself.
{ open(local *STDOUT , "| perl tee.pl -a $fErrorLogFile" ); $| = 1; ... } print "Some text....\n";
|
|---|