Prasanthi Tenneti wrote: > > Iam a beginner in perl.I have one question, > Iam trying to write one prog,in which i have to search for one word in a > file, > If I found that word,print next 4 lines. > PLs help me,how to write code.
open FILE, "<filename";
while (<FILE>) {
print(<FILE>,<FILE>,<FILE>,<FILE>), last if /your_word/;
}
close FILE;
Best Wishes,
Andrea
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
