use Benchmark 'cmpthese'; use strict; my $x = 0; our $y = \$x; cmpthese( 10000000, { 'braces' => sub { return ${ $y } }, 'nobraces' => sub { return $$y }, });