On Saturday 23 October 2010 18:50:44 David Favor wrote: > Given an instantiated class object, what's the > best way to add additional methods after instantiation. > > Specifically I'm working with qpsmtpd and desire to > add a method is_spooled() to every session, so I can > call if ($self->is_spooled) rather then is_spooled($self)... >
Maybe try Class::MOP's add_method: http://search.cpan.org/perldoc?Class::MOP::Class There are closer-to-the-metal ways but they are probably less recommended. Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ "The Human Hacking Field Guide" - http://shlom.in/hhfg <rindolf> She's a hot chick. But she smokes. <go|dfish> She can smoke as long as she's smokin'. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/