sub foo { CORE::say "ok" } my %h; my $ref1 = \%h; my $ref2 = \%h; bless($ref1); $ref2->foo();