In my script I open two file handles, one is a pipe to sendmail to send email, and the other is a file handle to a local file on the system. How can I print to both of these at the same time?
Is there anything better than this?
Code:
$sendmail = "/usr/sbin/sendmail -t";
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
open(FILE, "<fileXYZ") or die "Cannot open fileXYZ for writing: $!\n";
Is there anything better than this?
Code:
print SENDMAIL "foo\n";
print FILE "foo\n";