in reply to Re^2: How do I redirect outut from system () to a file and also to screen
in thread How do I redirect outut from system () to a file and also to screen

You won't tee your STDERR with backticks, though. All they do is point the command's STDOUT to a string, which is then given back to you. STDERR still goes to the original STDERR, unless you do  `command 2>&1`, which will include the error messages too.

This seems to work even under Win, even though it's bash syntax.
Update: as eyepopslikeamosquito already points out below

This, of course, shoves everything in the same log, which is not optimal - Log::Log4perl is probably your best friend here, and it will do you a ton of good in the future too, once you learn its ways

  • Comment on Re^3: How do I redirect outut from system () to a file and also to screen
  • Download Code