Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: What is safe to do in an END block?

by Starky (Chaplain)
on Jun 02, 2008 at 06:20 UTC ( #689639=note: print w/replies, xml ) Need Help??

in reply to What is safe to do in an END block?

I worked on a system to send alerts when servers suffered difficulties. The system had to be fault-tolerant as possible, so I used the END block to record some state information in a flat file and execute a system command to sendmail (or whatever mail sender was installed) to send any pending alerts along with a message indicating abnormal termination as a result of a die() or anything else out of the ordinary. The script also tried to restart itself on exit.

It seemed to work as intended, and if you have any reservations about Perl's ability to perform complex operations in the end block, committing some state information to a flat file may be a good Plan B.

  • Comment on Re: What is safe to do in an END block?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://689639]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2018-05-22 09:03 GMT
Find Nodes?
    Voting Booth?