use strict; use warnings; use Time::HiRes qw(time); # Create a large hash my %hash; my $count = 3_000_000; $hash{$count} = rand(10) while $count--; # Undefine it print "Undefining hash.\n"; my $before = time; undef %hash; printf "Done in %.03f seconds\n", time - $before;