in reply to Re^3: How to identify the package of a subroutine given only a reference to it
in thread How to identify the package of a subroutine given only a reference to it
I'm partial to array backed objects where applicable. But I've never actually tried a blessed code ref... until 5 minutes ago after reading your reply! It might be a good solution to my application.
Out of interest, do you have insight on how perl knows to call the underlying code ref and not a method that may or may not be in the package? An extra lookup/check must be done when called?
Thanks again for you comments#eg $code_ref_obj->();#calls code ref directly $code_ref_obj->a_method(); #Call a method on the object
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: How to identify the package of a subroutine given only a reference to it
by LanX (Saint) on Feb 02, 2022 at 01:00 UTC | |
by drclaw (Acolyte) on Feb 02, 2022 at 22:56 UTC | |
by hv (Prior) on Feb 14, 2022 at 16:48 UTC | |
by drclaw (Acolyte) on Feb 19, 2022 at 04:37 UTC | |
by hv (Prior) on Feb 19, 2022 at 13:37 UTC | |
| |
by LanX (Saint) on Feb 02, 2022 at 23:04 UTC |
In Section
Seekers of Perl Wisdom