hi all,
i'm now trying to match a number of lines in a txt file...for example, my
txt file is:

abc
xyz
fred
wilma
barney
anything

and my code is:

while (<>)  {
   if (/(fred\nwilma\n\barney)/)  {
       print "$1\n";
   }
}

but actually it returns nothing...i guess "while (<>)" reads the file line
by line, so it can not match several lines at a time...right?

so how can i match multiple lines in a file?
thanks in advance~~ :)

Reply via email to