in reply to Eval, assignments, and empty string/undef
This works as expected (IE does not die) for any value of $foo except undef or empty string.
It did not die for those either.
therefore $@ should not get set
Why do you say that? It always gets set, either to the caught exception or to undef.
It's easy enough to work around this (mis-)behavior by putting a no-op at the end of the eval block:
It's not a no-op, it's an expression that returns a true value.
I'm curious as to why it works this way.
Confused about what a function is returning? Check the docs! eval is like a sub. The last value evaluated is returned.
|
---|