use strict; use warnings; my %h; foreach my $i (0..10000) { $h{$i} = $i+10; } my $j = %h; print "$j";