Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by Starky (Chaplain)
on Jun 02, 2008 at 06:20 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://689639]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2024-04-24 14:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found