When you are matching multi-line strings, you need the /m and /s modifiers. Without the /s, a "." does not match a newline. Without the /m, "^" and "$" match start and end-of-string, not start and end-of-line.

Assuming that you have slurped the two lines of your file into a single string, this code will demonstrate a match.

Bill's solution is perfect if you have slurped the whole file into a scalar variable. Assuming you are reading the file line by line, you could use the flip-flop operator to print everything between the first match and the second one:

Thanks very much for your replies. The flip flop operator helped a lot in my output. I was able to extract the information i needed. Now, my only issue is the output is assigned to a $var, which should be printed out in an email alert. The issue i am having is 2 emails get generated :(

1 for the first line and another for the second. Any easy way to handle that scenario?