Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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]
[chacham]: finally fixed it. just changing it in all my projects... then maybe to finally fix the junit error i've been ignoring
Discipulus slow typer.. :=(

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-03-29 08:16 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (344 votes). Check out past polls.