in reply to What is safe to do in an END block?
Do as little as you possibly can in your handler; notice how all we do is set a global variable and then raise an exception. That's because on most systems, libraries are not re-entrant; particularly, memory allocation and I/O routines are not. That means that doing nearly anything in your handler could in theory trigger a memory fault and subsequent core dump.This was also the state of signal handling when Programming Perl 3rd edition was written - maybe that's where you read it?
|
|---|
| 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 20:56 UTC |