in reply to Re: Devel::EvalError lives
in thread Devel::EvalError lives

No, I won't be using Contextual::Return. Anything that feels the need to globally override something as basic as caller isn't something that other modules should depend on (and it appears to have relatively little reason to override it, but I haven't looked at it). Going from my "Chance of success 100%" to a subset of Contextual::Return's "Change of success 63%" is certainly not worth the proposed convenience (not to mention the subtle complexity).

It might be worth having a function that takes a code ref (and a separate one that takes a string). Given the serious problems with such minor magic that made Error something to avoid (Re: Re2: Learning how to use the Error module by example), I didn't want to repeat that mistake.

But it may be that EvalBlock { ... } would only change the semantics exactly as much as eval { ... } would anyway. I'll have to contemplate that a bit (I was thinking that there was some trap with regard to making closures, but a memory leak in old Perls is not enough to prevent me from offering such a simpler interface). I had intended to research that issue but failed to, so thanks for reminding me.

Part of the reason that I didn't go down that road is that I wanted to allow the user to choose how to make their eval "expect one". But I guess I could take a string or block but still leave the appending up to the user (where it will be visible to the next person to read the code). I also didn't want to have to have 4 routines. But I've since decided to pretty much deprecate ExpectNonEmpty(), so just having EvalString and EvalBlock might be the way to go.

I'll at least leave the current interface available for those who want to avoid memory leaks in certain Perl versions.

Thanks again.

- tye