ronix has asked for the wisdom of the Perl Monks concerning the following question:
Any suggestions for a better way of checking for success other then the old $? ? thanks for your time.# subroutine for mailing/transferring the changes sub mail_changes { my $mailer = "|/bin/mail -s $hostn $recipients < $disk_changes"; open (MAIL, $mailer) || die "Cannot execute mail command; $!\n"; close(MAIL); if ($? > 0) { print "Do some error stuff if needed\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Checking mail command for success
by ikegami (Patriarch) on Apr 21, 2009 at 20:19 UTC | |
by ronix (Novice) on Apr 23, 2009 at 19:27 UTC | |
by ikegami (Patriarch) on Apr 23, 2009 at 19:37 UTC | |
|
Re: Checking mail command for success
by mr_mischief (Monsignor) on Apr 22, 2009 at 02:48 UTC | |
|
Re: Checking mail command for success
by kwaping (Priest) on Apr 21, 2009 at 23:06 UTC |