in reply to Finding the interface implemented by an object
Is there any other way to find out which methods an object implements, i.e. it's interface?
Since there's no notion of 'interface' in perl, you would need to implement a method $obj->interface,or some such, in a class. Walking the symbol table doesn't lead to reliable results either, since inspecting the CODE slots of typeglobs doesn't tell you which package those code refs were compiled into. See What CODE typeglob slot is my anonymous sub in? for details. (There's not much difference between anonymous coderefs and those stored in a glob besides the fact that the latter are stored in a typeglob slot.)
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|