in reply to Re^5: Function name in a variable, can't recall the concept (introspection with ->can )
in thread Function name in a variable, can't recall the concept

What about a base class? Do such classes always have a declared  @ISA that is empty?


Give a man a fish:  <%-{-{-{-<

  • Comment on Re^6: Function name in a variable, can't recall the concept (introspection with ->can )
  • Select or Download Code

Replies are listed 'Best First'.
Re^7: Function name in a variable, can't recall the concept (introspection with ->can )
by LanX (Saint) on Apr 17, 2019 at 09:09 UTC
    Actually I don't understand the discussion anymore, if the OP was willing to inspect a class the natural solution would be ->can.

    If he wasn't inspecting a class ->can would do the job, too.

    Are there pathological cases where an approach might break?

    Of course, this is Perl, with high flexibility to bend internals.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      No, that's not true.

      If they're trying to resolve a method, then ->can is correct.

      If they're trying to resolve a sub, then ->can can fail

      The OP is looking for a sub.