http://qs1969.pair.com?node_id=434926


in reply to printing specific lines

as i understand: store the line number in a hash instead, so
my %lines = map { ($_, 1) } qw/1 3 5 7/; open(IN, "<grep") or die; while (<IN>) { print OUT $_ if $lines{$.}; }
HTH