#/usr/bin/perl -w use strict; use Benchmark; sub f { our %d; local *d = shift; $d{$_}=$_ foreach (0 .. 200); } sub b { my $d = shift; $$d{$_}=$_ foreach (0 .. 200); } my %c; timethese (100000, { 'f' => '&f(\%c)', 'b' => '&b(\%c)', });