my $f1 = "fileName1"; my $f2 = "fileName2"; open my $fh_email, ">", $f2; #Print stuff to $fh_email open($fh, "| tee -a $f1 $fh_email") or die "Teeing off: $!\n"; #Several other variations I have tried #open($fh, "| tee -a $f1 \*$fh_email") or die "Teeing off: $!\n"; #open($fh, "| tee -a $f1 \\*$fh_email") or die "Teeing off: $!\n"; #open($fh, "| tee -a $f1 \\*\$fh_email") or die "Teeing off: $!\n"; #open($fh, "| tee -a $f1 \*\$fh_email") or die "Teeing off: $!\n"; #Which was a big mistake as I appended bunch of stuff into lots of file (which of course I simply did svn revert *) #Print stuff into both files close $fh; #Then continue printing to $fh_email #### sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `tee -a fileName1 \*GLOB(0x2c06b18)'