in reply to Line ending transformation

Can anyone spot the problem? It removes the character before and after the line ending.
No it doesn't. Those are assertions, not included in the part of the string being replaced. Your problem must lie elsewhere.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: •Re: Line ending transformation
by iburrell (Chaplain) on Feb 28, 2003 at 20:50 UTC
    I posted the corrected code by mistake. The original version didn't have assertions.
    $main::stateIn{'address'} =~ s/[^\015][\012\015][^\012]/\015\012/g;
    The code with assertions works properly with single lines but fails with multiple blank lines.