http://qs1969.pair.com?node_id=11137344


in reply to Re: Is there a Perl API (XS) for ->can ?
in thread Is there a Perl API (XS) for ->can ?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: Is there a Perl API (XS) for ->can ?
by chromatic (Archbishop) on Oct 08, 2021 at 16:51 UTC

    You have to read between the lines a little bit, but the last large block of text in the EXPORTS section explains why calling isa as a function can give you the wrong results. The same reasoning applies to calling can as a function.

      > You have to read between the lines a little bit

      What about the WARNINGS part?

        NOTE: can directly uses Perl's internal code for method lookup, and isa uses a very similar method and cache-ing strategy. This may cause strange effects if the Perl code dynamically changes @ISA in any package.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        I think that affects both the method and function forms, but I don't have code that proves it at the moment.

Re^3: Is there a Perl API (XS) for ->can ?
by Anonymous Monk on Oct 08, 2021 at 15:21 UTC