in reply to fuzzy logic?

This is untested, but should work just fine.
sub process_file { my $file=shift; open(IN,"<$file") || die "Couldn't open '$file': $!\n"; my @in=(<IN>)[0..9]; close IN; if (join('',@in)=~/\r\n/m) { ## found! ## do something exciting here } }

Update It would probably be more intellient to

push @in,scalar <IN> for 1..10;
as my original code seems to snarf the entire file and THEN return the first 10 lines.