in reply to Re: why "Bless" in OO Perl
in thread why "Bless" in OO Perl
Actuall the thing being referenced is blessed; the reference is still just a reference. The blessing changes the referent, not the reference itself. A new reference taken to the same referent will exhibit blessed / object-y behavior.</pedant>
use strict; {package Foo; sub oik { print "oik\n" } } my $x = bless [], "Foo"; $x->oik; our @y; *y = $x; ( \@y )->oik;
Zaxo's explanation below shows this as well.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: why "Bless" in OO Perl
by davido (Cardinal) on May 03, 2006 at 15:37 UTC | |
by Roy Johnson (Monsignor) on May 03, 2006 at 17:34 UTC | |
by Fletch (Bishop) on May 03, 2006 at 17:54 UTC |