Michael G Schwern wrote:
Hold up. Why won't isa() work on base version objects? What's a "base"
version object? Did you instead mean so it will work on non-object references
(ie. hash refs, etc...)? Or did you mean normal string/number versions?
Oh, isa() will work fine with base version objects (meaning not a
version subclass), but rather than completely restructure the code, I'm
still taking a ref($val) (which will be the class name for objects). If
the class name matches exactly, the first half of the test will succeed
and the eval will never fire. If not, we have the second half which
will test if an object is a child of the class we are testing. This
should be future proof above and beyond the initial 'version' case.
{ $_ && ($given eq $_ || eval{$val->isa($_)) }
If you eliminate that how will it display the right message when it accepts a
non-reference?
Yeah, ignore that; I realize that I can't cheat at that point in the
testing.
As soon as I get some tests, I'll put the patch into RT...
John