I'm aware of the fact that $@
is a global variable, still I can't figure out why I need to localize it before using eval:
For instance:
eval { SOME_FUNC_THAT_MAY_DIE(); };
if ($@) {
print "An error occured!\n";
}
The only possible thing I can think of is, if some signal handler will call die
at the same time I try to read $@
, what am I missing here?
potentially clobbering an error that is currently being caught
mean? ;-) – Nominee