$ perl -le 'sub localdie { local $@; die "DIED\n" }; eval { localdie(); }; print $@||"cleared\n"' cleared > Why? The docs doesn't say this. The fact that die actually sets $@ > and not the outer eval { } that does the assignment is not mentioned > or even hinted at in the docs, and there is little benefit from this > behavior. i don't think it is accurate to say "die sets $@" I believe eval sets $@ to whatever the "death rattle" of the contents were, and die is a way of forcing such. I believe local sets aside the current value of something until its scope is torn down, then it assigns it back. I believe the confusion arises from lack of explicit documentation of the order of the two operations in question here, which are, in the order they appear to be happening, 1: assignment of "DIED\n" to $@ 2: restoring the old value I think it is reasonable to expect the assignment of the death rattle to $@ by the eval framework would occur _after_ the stack frame is torn down including the restoration of local variables. I think Abigail can be something of a show-off. -- ... but world war IV will be fought with rocksThread Previous | Thread Next