Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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 ( [id://1232705]=note: print w/replies, xml ) Need Help??


in reply to Re^6: 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

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

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

Replies are listed 'Best First'.
Re^8: Function name in a variable, can't recall the concept (introspection with ->can )
by ikegami (Patriarch) on Apr 19, 2019 at 09:03 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1232705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found