in reply to Redirecting and using output from executed program

Hey,

I don't know if this is one of the best solutions, but I did it once like this:
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;
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 ;-)
--
to ask a question is a moment of shame
to remain ignorant is a lifelong shame