Not bad. One "error" I can see: you're not checking the return code from sendmail (which will be available in $? after the close).
I would also strongly consider making a new module for "raising alert messages" for your system, so that if later on you decide that sending an email when there's a problem get unmanagable, you can get it to post it to your favourite error processing tool by changing your system in one place. Another approach is to raise a critical event to the system log with something like Sys::Syslog, and use a program like xlogmaster to catch them after that.
In reply to Re: how can this be improved?
by mugwumpjism
in thread how can this be improved?
by blueflashlight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |