chomp(my $count = <>); my @numbers; for (1 .. $count) { chomp(my $line = <>); die if $line < 1 || $line > 1_000_000; push @numbers, $line; }