one surprising aspect of perl is that C<bless> affects the object, not
the reference, so it is possible to rebless things, which is handy if
you use package-based state machines

D:\>perl -le "bless $o=[],'abc';print $o; sub f{$l=shift; bless
$l,'DEF'} f $o; print $o"
abc=ARRAY(0x3e5444)
DEF=ARRAY(0x3e5444)

because after C< my $self = shift > you can bless $self and the
invocant will get reblessed.

So whenever anyone says "a Perl object is a blessed reference" they're
speaking procedurally, not descriptively. Descriptively, a Perl object
is a reference to a blessed thingy.

(I think that's correct terminology, please correct if wrong)

Reply via email to