my $file = 'somefile.txt'; my $str1 = 'mystring1'; my $str2 = 'mystring2'; open F, $file while () { Read file line by line, grab the last possible "str1" found in file, look for str2 from that point onward. If no str2 is found after str1 was found, alert me }