use Benchmark qw/cmpthese/; my %landab = ( "austria" => "a", "belgium" => "b", "switzerland" => "ch", "germany" => "d" ); cmpthese( 0, { hash => sub { my %badnal = reverse %landab; my $land = $badnal{a}; }, anon => sub { my $land = {reverse %landab}->{a}; }, });