fw() for 1 .. 10; sub fw { my %uniq; for my $ix ( 0 .. 100 ){ for my $key ( wf() ){ my $count = $uniq{$key}++; if( $count > 1 ){ my $keycount = keys %uniq; my $buckets = %uniq; print "started repeating at iteration $ix after only $keycount in $buckets buckets \n"; return; } } } } sub wf { my %f; $f{ [] } = [0]; $f{ [] } = [1]; $f{ [] } = [2]; $f{ [] } = [3]; return keys %f; } __END__ started repeating at iteration 8 after only 26 in 20/32 buckets started repeating at iteration 4 after only 14 in 13/32 buckets started repeating at iteration 5 after only 17 in 14/32 buckets started repeating at iteration 5 after only 17 in 13/32 buckets started repeating at iteration 5 after only 19 in 15/32 buckets started repeating at iteration 5 after only 18 in 16/32 buckets started repeating at iteration 6 after only 18 in 16/32 buckets started repeating at iteration 7 after only 20 in 15/32 buckets started repeating at iteration 6 after only 18 in 14/32 buckets started repeating at iteration 7 after only 26 in 21/32 buckets