Get specific lines from a huge text file
I know this might be a one time task, however, if you want to create a reusable code, I would always put the line counting code in a "continue" block. It is more readable and safer for future enhancements. Somehow the line increment code "finds itself" pushed after a next statement...

while (my $line = &lt;$i_fh&gt;) {
    chomp $line;
    if (defined $indices{$lines_parsed}) {
        print $o_fh $line, "\r\n";
        $lines_found++;
    }
} continue {
    $lines_parsed++;
}