#!perl use Benchmark; my %l_hash; sub use_global_hash { ++$hash{ 'foo' . $_ } for 0 .. 1000 } sub use_global_vars { ++${ 'foo' . $_ } for 0 .. 1000 } sub use_lexical_hash { ++$l_hash{ 'foo' . $_ } for 0 .. 1000 } timethese -10, { use_global_hash => \&use_global_hash, use_global_vars => \&use_global_vars, use_lexical_hash => \&use_lexical_hash, }; __END__ > t-b-symref.pl Benchmark: running use_global_hash, use_global_vars, use_lexical_hash for at least 10 CPU seconds... use_global_hash: 11 wallclock secs (10.58 usr + 0.00 sys = 10.58 CPU) @ 744.83/s (n=7884) use_global_vars: 10 wallclock secs (10.54 usr + 0.02 sys = 10.56 CPU) @ 561.35/s (n=5925) use_lexical_hash: 11 wallclock secs (10.65 usr + 0.00 sys = 10.65 CPU) @ 794.74/s (n=8460)