in reply to Two lines Regular Expression

How about:

while(<TMPFILE>) { if (/myword/) { $_.=<TMPFILE>; print; } }

Basically, if the current line matches read and append the next line and print. The while loop only reads one line at a time(unless you change $/), so the nextline will just not be in $_ in your code, you have to read it in when you match myword.

HTH