in reply to How do I redirect outut from system () to a file and also to screen

If u can use other commands than system()..u may use open() like this:
open (logHdle, ">C:/path2log.txt"); open (progHdle, "ping somehost|"); while(<progHdle>) { print logHdle $_ ; print STDOUT $_; } close(logHdle); close(progHdle);
I havent tested the code, but it should work
  • Comment on Re: How do I redirect outut from system () to a file and also to screen
  • Download Code