Re: Object introspection + adding method - SOLVED

2010-10-26 Thread C.DeRykus
On Oct 23, 2:37 pm, da...@davidfavor.com (David Favor) wrote: [omitted] > > Just be sure you know what you are doing.  Adding a method to somone else's > > class can be considered rude.  See the NOTE in perldoc perlmodlib. > > sub add_class_method { >      my($class,$name,$code) = @_; >      no

Re: Object introspection + adding method

2010-10-25 Thread Dr.Ruud
On 2010-10-23 18:50, 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_spoo

Re: Object introspection + adding method - SOLVED

2010-10-24 Thread C.DeRykus
On Oct 23, 2:37 pm, da...@davidfavor.com (David Favor) wrote: > Paul Johnson wrote: [snip] >      add_class_method($class,$name,$code); > >      # all three of these invocations works correctly >      test_method($self); >      &$code($self); >      $self->test_method; > > } Hm, strawberr

Re: Object introspection + adding method

2010-10-24 Thread Jenda Krynicky
From: "Jeff Peng" > > On Sat, Oct 23, 2010 at 07:52:50PM +0200, Shlomi Fish wrote: > > > > > Just be sure you know what you are doing. Adding a method to somone > > else's > > class can be considered rude. See the NOTE in perldoc perlmodlib. > > > > He/she is maybe coming from other language l

Re: Object introspection + adding method

2010-10-23 Thread Jeff Peng
> On Sat, Oct 23, 2010 at 07:52:50PM +0200, Shlomi Fish wrote: > > Just be sure you know what you are doing. Adding a method to somone > else's > class can be considered rude. See the NOTE in perldoc perlmodlib. > He/she is maybe coming from other language like Ruby. In ruby it's free to add me

Re: Object introspection + adding method - SOLVED

2010-10-23 Thread David Favor
Paul Johnson wrote: On Sat, Oct 23, 2010 at 07:52:50PM +0200, Shlomi Fish wrote: 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 ad

Re: Object introspection + adding method

2010-10-23 Thread Paul Johnson
On Sat, Oct 23, 2010 at 07:52:50PM +0200, Shlomi Fish wrote: > 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

Re: Object introspection + adding method

2010-10-23 Thread Shlomi Fish
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_spo

Object introspection + adding method

2010-10-23 Thread David Favor
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)... Thanks. -- Love feeling yo