XP is just a number | |
PerlMonks |
Re^3: Adding functionality to an Objectby gellyfish (Monsignor) |
on Jul 13, 2006 at 09:17 UTC ( [id://560896]=note: print w/replies, xml ) | Need Help?? |
In the first instance you might want to look at perlboot and perltoot as they both cover Inheritance. As to adding methods to a class at runtime, yes that is entirely possible (you will find a number of modules that do this in a sub AUTOLOAD,) but you might want to carefully review your design as it is probably not the best solution in the general case. However if you really insist on adding methods dynamically you can do something as simple as:
/J\
In Section
Seekers of Perl Wisdom
|
|