I don't see why it has to be called print (this was
mentioned as a specific error reporting problem, I believe)...
sub writeError {
print STDERR @_;
print FILE @_;
# yes I know that should be Mail::Mailer, but I don't know its synta
+x
open MAIL, '|/usr/sbin/sendmail admin' or die;
print MAIL @_;
close MAIL;
}