in reply to Referencing methods
Pass the object in only, not the subroutine name. Force all objects that are passed in to have a certain method name (which you can check with $obj->can('method_name') which you then call. If you need a single sub that can handle either an object OR a subreferance, just check the output of ref() and mix in some DWIM.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|