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

Re: Confused by eval behavior

Thread Previous | Thread Next
From:
Zefram
Date:
June 24, 2016 19:10
Subject:
Re: Confused by eval behavior
Message ID:
20160624190957.GJ1170@fysh.org
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.

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About