http://www.perlmonks.org?node_id=863418


in reply to Re^8: eval to replace die?
in thread eval to replace die?

The caught() method in E::C 1.32 includes the type check: return unless blessed($e) && $e->isa( $_1 );

Yep! Same code. Which brings us right back to my first question way back up there.

What does isa() do?

This is what it does:

int Perl_sv_isa(pTHX_ SV *sv, const char *const name) { const char *hvname; PERL_ARGS_ASSERT_SV_ISA; if (!sv) return 0; SvGETMAGIC(sv); if (!SvROK(sv)) return 0; sv = SvRV(sv); if (!SvOBJECT(sv)) return 0; hvname = HvNAME_get(SvSTASH(sv)); if (!hvname) return 0; return strEQ(hvname, name); }

It check you've given it an sv, checks it's a reference; checks the refenced thing is an object; gets the package name from the stash where the object is stored; and then string compares that with the type-name string you passed in.

(And all of those same check will be followed when a reference is stringified!)

Now lets go back to where we came in with you saying:

If you're performing an exact match, a substring match, or a regular expression, any change to the text of that message in a subsequent release of Perl 5 could change the way your code behaves.

So are you now saying that exact matches are okay?

That its only regex matches that are "unreliable"? (Or are substring matches still verbotten?)

If so, why are you ignoring the ref versions that used string compare instead of the regex engine?

And why are you still insisting that Perl's regex engine is unreliable?

What all your snide asides and unstated implications resolve to, is that the regex engine is incapable of safely comparing strings.

Which you know is rubbish!

(And once again I'll ask you to post code so we can all test your assertions!)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.