foreach (sort {$a <=> $b} keys %wanted) { print "$_ -> $wanted{$_}\n"; }