use Benchmark 'cmpthese'; my %hash; cmpthese( 10000000, { with => sub {delete $INC{strict.pm}; use strict 'refs'; my $a = 1; my $b = 2}, without => sub {delete $hash{key}; my $a = 1; my $b = 2}, } ); __DATA__ Benchmark: timing 10000000 iterations of with, without... with: 8 wallclock secs ( 9.10 usr + 0.00 sys = 9.10 CPU) @ 1098538.94/s (n=10000000) without: 3 wallclock secs ( 4.04 usr + 0.00 sys = 4.04 CPU) @ 2478314.75/s (n=10000000) Rate with without with 1098539/s -- -56% without 2478315/s 126% --