yes, this is helpful, so I won't re-bless any object now.

On 5/18/06, Tom Phoenix <[EMAIL PROTECTED]> wrote:
On 5/18/06, Ken Perl <[EMAIL PROTECTED]> wrote:

> how to rebless another object in current package's constructor? could
> somebody give me an example?

perlobj sez:

  Although a constructor can in theory re-bless a referenced
  object currently belonging to another class, this is almost
  certainly going to get you into trouble.  The new class is
  responsible for all cleanup later.  The previous blessing is
  forgotten, as an object may belong to only one class at a time.
  (Although of course it's free to inherit methods from many
  classes.)  If you find yourself having to do this, the parent
  class is probably misbehaving, though.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training



--
perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"[EMAIL PROTECTED]
")'

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to