open BIG, ' ) { s/^\d{2}:\d{2}(.*)$/$1/; $match=0 and next unless $_ eq @find[match++]; next unless $match == scalar @find; # If you got this far, you've matched all the lines in the smallfile # as contigeous lines in the bigfile. So do something... # If you need to know where the sequence of matching lines started (in the bigfile) # $. = scalar @find will tell you. $matched = 1; } close BIG or warn "Couldn't close bigfile; $!"; print "Didn't find the contents of smallfile in bigfile\n" unless $matched;