But you need not call it inside the script itself. You can also append the tee to the script invocation.
OTOH: When it's your script, you can also change all your print commands to "logger" commands and do the proper output there. That way you don't depend on any other module and need not call an external program.
#each
print "this is my ",$test;
# would become
logger("this is my ", $test);
You will also need to have a logger function and a LOGFILE. Something like this
open LOGFILE, '>>', $log_file;
sub logger {
print LOGFILE @_ if defined $log_file;
print @_
}
s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
|