http://www.perlmonks.org?node_id=260612


in reply to Re: Determining the true type of a reference
in thread Determining the true type of a reference

+=0 (you meant well)

That won't work little. Try changing this line in showarray: print ref($aref), ": @$aref"; to

print ref($aref); print "@$aref";
and you will see that it outputs 'ARRAY' which is wrong. In this case, $aref is a SCALAR reference that is blessed into the class ARRAY.

Replies are listed 'Best First'.
Re: Re: Re: Determining the true type of a reference
by little (Curate) on May 24, 2003 at 17:37 UTC

    that won't work due to your own belssing I assume
    my $blessed = bless($ref, 'ARRAY'); # bless the scalar reference into class ARRAY

    Have a nice day
    All decision is left to your taste

      Right. Reread my OP to see why I did that.