in reply to Redirecting and using output from executed program
and all standard print messages go to the log file, as well as all the error messages... yes, even the error messages of executed commands ;-)open(LOG_FILE,">$log_file") || die "Unable to open $log_file: $!\n"; my $old_err = *STDERR; my $old_out = *STDOUT; # Redirecting STDERR and STDOUT to the log file handle *STDERR = \*LOG_FILE; *STDOUT = \*LOG_FILE;
|
|---|