in reply to Adding functionality to an Object
Yes. You can do that.
The best way is probably to subclass the object and add your new methods to the subclass. But it's perfectly possible to add methods to an existing object. A method is just a subroutine that exists in a particular symbol table. You just have to switch to the correct package and define a new subroutine.
--
<http://dave.org.uk>
<http://dave.org.uk>
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Adding functionality to an Object
by jeanluca (Deacon) on Jul 13, 2006 at 09:02 UTC | |
by gellyfish (Monsignor) on Jul 13, 2006 at 09:17 UTC | |
by davorg (Chancellor) on Jul 13, 2006 at 09:18 UTC | |
by xdg (Monsignor) on Jul 13, 2006 at 12:46 UTC |
In Section
Seekers of Perl Wisdom