in reply to When CGI->new doesn't return a CGI object
At the risk of being niggly...
References can be blessed. And because the slots in a typeglob are references, they can be blessed too. Just like you would bless anything else. And because if you reference something that is dereferenced, you get the same reference you dereferenced, the reference would still blessed, if it was originally.
It's the referent that is blessed into a package, not the reference. When you do:
my @foo = (1,2,3); bless \@foo, 'Bar'; my $x = \@foo; my $y = \@foo;
Then $x and $y are different references that refer to the same array, which has been blessed into the Bar package.
Chapter 3 of TheDamian's Object Oriented Perl covers this topic well for those who are as pedantic as I am :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: When CGI->new doesn't return a CGI object
by demerphq (Chancellor) on Jan 07, 2003 at 21:33 UTC |