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

Well, this tells us that
An END code block is executed as late as possible, that is, after perl has finished running the program and just before the interpreter is being exited, even if it is exiting as a result of a die() function. (But not if it's morphing into another program via exec, or being blown out of the water by a signal--you have to trap that yourself (if you can).)

Emphasis mine. This suggests to me that updating a database would be Too Much for an END block.

But then, I'm just a Perl Pisher. One of the Perl Hackers should have something more definitive to say.

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

Replies are listed 'Best First'.
Re^2: What is safe to do in an END block?
by Cap'n Steve (Friar) on Jun 01, 2008 at 04:13 UTC
    Yeah, reading that doesn't exactly fill me with confidence. Maybe we're misinterpreting it, but it does seem to suggest that the rest of the program (modules, etc.) could be inaccessible by the time END gets run.