chomp( my @input = ); for (sort { $a <=> $b } @input) { next if /\D/; last if $_ > 1_000_000; print "$_\n"; } ####