On Tue, 6 Feb 2001 17:53:17 -0200, Branden wrote:

>It appears you're blessing one reference and returning another... like
>
>    sub new {
>        my $key;
>        my $a = \$key;
>        my $b = \$key;
>        bless $a;
>        return $b;
>    }
>
>I think the problem is not with the overloading magic, but with the code
>snippet...

A recent thread on comp.lang.perl.misc discussed how bless() works with
the reference, but alledgedly, it's the underlying thing that gets
blessed, not the reference itself.

        my $a = \$x;
        my $b = \$x;
        bless $a, 'FOO';
        print $b;
-->
        FOO=SCALAR(0x8a652e4)

It sure looks that they're right. Oh, this is perl 5.6.0.

-- 
        Bart.

Reply via email to