or, if you don't need a name and like the 0 values:my %statistics; undef @statistics{ 1..10 }; # or @statistics{ 1..10 } = (0) x 10 say join "\n", sort { $a <=> $b } keys %statistics;
say join "\n", sort { $a <=> $b } keys %{{ map { $_ => 0 } 1..10 }}
In reply to Re^2: Sorting integer value hash keys
by JadeNB
in thread Sorting integer value hash keys
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |