in reply to how can this be improved?

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.

Replies are listed 'Best First'.
Re: Re: how can this be improved?
by blueflashlight (Pilgrim) on Aug 21, 2001 at 21:55 UTC
    Thanks for the advice; I'll do that return code checking (I always confuse $! and $? ... maybe I should tatoo them on my arm)

    I did think about breaking the script into a "modular" form, but because of the way it will be used (called as an event handler by the error reporting subsystem, via an ODM lookup), I thought it best to keep it all self-contained.

    thanks again!