in reply to problem with 'bare LF' in script

You could: $_main_Message =~ s/(?<!\0x0d)\x0a(?!\0x0d)/\x0d\x0a/g;.


Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^2: problem with 'bare LF' in script
by powerhouse (Friar) on Nov 12, 2008 at 00:06 UTC
    Thank you, Grandfather, but that did not work...

    Still trying solutions if you know of anything else, I'd appreciate it.

    thx,
    Richard
      No idea if this will help:
      $str =~ s/(\r\n|\n\r|\r|\n)/\r\n/sg;
      where \r is a carriage-return and \n is a line-feed. This code will convert every type of line ending to a CR-LF pair.

      Update: removed parenthesis from replacement text

        See the Newlines section in perlport for why using \r and \n is a bad idea™ in this sort of context.


        Perl reduces RSI - it saves typing