develooper Front page | perl.perl5.porters | Postings from February 2021

Re: Blessed objects are `isa` their reftype

Thread Previous | Thread Next
Paul "LeoNerd" Evans
February 18, 2021 23:33
Re: Blessed objects are `isa` their reftype
Message ID:
On Fri, 19 Feb 2021 08:12:30 +0900
Yuki Kimoto <> wrote:

> Sorry, I misunderstanded.
> perl -e 'print( (bless [], "Foo")->isa("ARRAY")) . "\n"'
> result is 1.
> This is originally isa behavior.

Correct; that's how the ->isa method works.

I just don't think that's useful.

It is, at the very least, somewhat surprising. The string "ARRAY" does
not appear in the @ISA list of package Foo, nor anywhere else. No
method in such a package would be considered for method dispatch.

Paul "LeoNerd" Evans      |  |

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