in reply to Re^2: How to match and transform a multiline pattern?
in thread How to match and transform a multiline pattern?

Two thousand lines of text is not a great deal.
If you did treat it all as a single string, you could do a single $a =~ s/p/r/g;, changing all occurrences of the pattern p to r in buffer a.

Replies are listed 'Best First'.
Re^4: How to match and transform a multiline pattern?
by nbhatia (Novice) on Apr 20, 2007 at 19:32 UTC
    Agreed - 2000 lines is not large at all. I just sucked in the whole file and was able to convert it successfully using $a =~ s/p/r/g;.
    Thanks so much.
      Congratulations. And here I was about to post this boring screed on a Finite State Automata that would allow you to read one line at a time while learning if you had a four-line statement that was interesting ... 8-)