print "$foo{$_}\n" foreach sort {$a <=> $b} keys %foo;