in reply to Re^2: Two line match
in thread Two line match

The -p option enables line-by-line processing, so you have to change perls notion of a line:

perl -pe 'BEGIN { $/ = undef }; s/---\n---/---/g;'

Replies are listed 'Best First'.
Re^4: Two line match
by jrosenfeld (Initiate) on Mar 10, 2008 at 15:38 UTC
    That works except that it only converts two lines of ----- into one. I wanted it to be able to convert any number of lines on ----- into 1 line of it. Shouldn't the /g do that? Jeff
      The /g never handles overlapping matches in order to avoid infinite loops.

      But you can modifiy your regex: m/----(?:\n----)+/----/g