develooper Front page | perl.perl5.porters | Postings from October 2011

Re: Are exceptions "still broken" in core Perl?

Thread Previous | Thread Next
Joshua ben Jore
October 26, 2011 05:50
Re: Are exceptions "still broken" in core Perl?
Message ID:
We might be in global destruction and that object might have been
destroyed prior to being used. Something might have broken bigint::
from the outside. It might be a poorly behaved constant if the author
of the constant overloading class made some kind of mistake.

About the only thing that's reliable are XS macros. Maybe just SvOK.
You can't test $@ for that thought since it always has something in
it. SvTRUE || SvROK might work on $@ generally.


On Wed, Oct 26, 2011 at 2:34 AM, Chas. Owens <> wrote:
> On Oct 25, 2011 11:21 PM, "Joshua ben Jore" <> wrote:
>> That only works as long as your '1' hasn't been rewritten as an
>> overloaded literal.
>>    use bigint;
>>    eval {
>>        ...
>>        1; # secretly, an object which will have ->
>>    } or ...;
>> There's really nothing you can count on.
> Yes, but 1 would still be true in that case.  If the literal 1 cannot be
> counted on to be true, then lots if other assumptions are going to break as
> well.  People who muck about with constants are responsible for ensuring
> their code still works.

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