my $a = []; $a->[1]{bar}{baz}[3] = 7; bless $a, "hrmph"; *hrmph::deref = sub { $_[0]->[1]{bar}{baz}[3] }; print "yeah: ", $a->deref, "\n"; #### my $x = []; $x->[1]{bar}{baz}[3] = 7; bless $x, "whatever"; my $deref = sub { $_[0]->[1]{bar}{baz}[3] }; print "yeah: ", $x->$deref, "\n"; #### my $x = []; $x->[1]{bar}{baz}[3] = 7; # bless $x, "whatever"; my $deref = sub { $_[0]->[1]{bar}{baz}[3] }; print "yeah: ", $x->$deref, "\n";