How can I simultaneously print to two streams in perl?
open(LOG, "|perl -pe 's/\r//g'| ntlogformat 9 $delim \"\t\" ".
">>$tmp_logfile") or die "Can't >> $tmp_logfile $!";
open(ARCH, "|ssh svc_ntlogs\@$arch_host \"cd $arch_dir; cat >$logfile\"");
print LOG &ssh($log_ssh, "el/eldump -l application -l system ".
"-l security -K -Q -c $delim -x //$log_host");
print ARCH &ssh($log_ssh, "el/eldump -l application -l system ".
"-l security -K -Q -c $delim -x //$log_host");
ARCH is a pipe opened via an ssh connection to a remote server to a
remote file.
LOG is a pipe to a local file (after some formatting).
I know I can merge two streams:
open(STDOUT, ">file");
open(STDERR, ">&STDOUT");
Maybe I can fork a stream?
Thanks,
Cory