my $hash = { a => 'b' }; $hash->{$x} #### {a => 'b'}->{$x} #### our $hash = { 'a' => 'A', 'b' => 'B'}; our $y = 'bob'; cmpthese(-10, { 'hash' => sub { for my $x (qw(a b a b a b)) { my $y = { 'a' => 'A', 'b' => 'B'}->{$x}; }}, 'ref' => sub { for my $x (qw(a b a b a b)) { my $y = $hash->{$x}; }}, });