sub process_file { my $file=shift; open(IN,"<$file") || die "Couldn't open '$file': $!\n"; my @in=()[0..9]; close IN; if (join('',@in)=~/\r\n/m) { ## found! ## do something exciting here } } #### push @in,scalar for 1..10;