$word = "seminary";

I am trying to retrieve a word, and the surrounding text in a file. For 
example, read through a file for $word, and when matched, place in a variable 
the matching word, along with the 10 words preceding it and trailing it, and 
have it work over multiple lines. Is there an effective way to do this in 
Perl?  i.e., in the paragraph above, if I searched for the word "along" match 
would contain what is written below. Can anyone help me with this? Thanks.

$match = "and when matched, place in a variable the matching word, along with 
the 10 words preceding it and trailing it, and";





Reply via email to