XP is just a number | |
PerlMonks |
Re: Function name in a variable, can't recall the concept (introspection with ->can )by LanX (Saint) |
on Apr 14, 2019 at 14:16 UTC ( [id://1232552]=note: print w/replies, xml ) | Need Help?? |
If you want to appease your supervisor use UNIVERSAL::can()
I'm sure there is a similar method like can() in Python too. > What is the name of the idiom When talking to non-Perlers I'd use the general term "introspection"
Cheers Rolf
Update:->can is also strict and more stable, since you can easily catch missing subs. It won't work with AUTOLOAD though
In Section
Seekers of Perl Wisdom
|
|