in reply to How do I redirect outut from system () to a file and also to screen
I havent tested the code, but it should workopen (logHdle, ">C:/path2log.txt"); open (progHdle, "ping somehost|"); while(<progHdle>) { print logHdle $_ ; print STDOUT $_; } close(logHdle); close(progHdle);
|
|---|