note
zwon
<p>Though [doc://bless] indeed requires a reference as argument it actually <em>tells the thingy referenced by REF that it is now an object</em>, so it blesses the thingy, and not the reference:
<c>
use 5.010;
use strict;
use warnings;
my %hash;
say ref \%hash;
bless \%hash, "Whatever";
say ref \%hash;
__END__
HASH
Whatever
</c>
<p><b>PS</b> of course you can bless reference too:
<c>
use 5.010;
use strict;
use warnings;
my %hash;
my $ref = \%hash;
bless $ref, 'Array';
bless \$ref, 'Whatever';
say ref \%hash;
say ref \$ref;
__END__
Array
Whatever
</c>
969044
969048