develooper Front page | perl.perl5.porters | Postings from June 2016

Re: Confused by eval behavior

Thread Previous | Thread Next
June 24, 2016 19:10
Re: Confused by eval behavior
Message ID:
Aristotle Pagaltzis wrote:
>Does this thread constitute a case where it matters sufficiently to
>change it?

Yes.  To have a reliable $@ value immediately after eval is important,
and the programmer can't be expected to anticipate which things might
be mortalised and so capable of clobbering it.

However, one doesn't necessarily have to solve this by generally changing
the timing of temp freeing.  Another option is to save and restore $@
around temp freeing.  It's not obvious which of these would perform
better.  There may also be some option of changing timing just for eval,
which if possible would almost certainly have the best performance.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About