#!/usr/bin/perl -w
use strict;
my $status = print "this is a test\n";
print "first print returned $status\n";
__END__
output:
this is a test
first print returned 1
| [reply] [d/l] [select] |
print MAIL "From: $from\n";
print MAIL "To: $to_ad\n";
print MAIL "Subject: $subject\n\n";
my $stat = print MAIL "$message";
print "Mail Status: $stat\n";
close(MAIL) || warn "Error closing mail: $!";
print "Mail sent.\n";
I got:
Mail Status: 1
Mail sent.
But the mail still does not reach my box and the log reports "Error closing mail:"
| [reply] [d/l] |
Interesting - I was sort of suspecting that because the most common suspect for error (non-existent reader) would cause a SIGPIPE and you'd get different symptoms. I uploaded this code to a Linux box so I could play with it. Your code works fine on that machine verbatim. I haven't been able to come up with a scenario to force this close() error to happen. Sorry - I'm stumped. Maybe your system admin can shed some light on this?
| [reply] |