in reply to printing specific lines
as i understand: store the line number in a hash instead, so
HTHmy %lines = map { ($_, 1) } qw/1 3 5 7/; open(IN, "<grep") or die; while (<IN>) { print OUT $_ if $lines{$.}; }
In Section
Seekers of Perl Wisdom