in reply to Search for a string in a file and get the string in the next line

Read the file line by line, and if one line matches your pattern, store that information in a variable. Previously to matching, you print out the current line if that same variable indicates the the previous line matched.

See also: perlintro, Super Search

Perl 6 - links to (nearly) everything that is Perl 6.
  • Comment on Re: Search for a string in a file and get the string in the next line