in reply to Re: extracting lines from a string - while ignoring the \n character
in thread extracting lines from a string - while ignoring the \n character

Your approach works. IO::String comes to your rescue ;-)
$ cat test.txt bla. fasel . foo . bar. $ perl -e ' use IO::String; $str=`cat test.txt`; $fh = IO::String->new($str); $/="."; print "$_|" for <$fh>' bla.| fasel .| foo .| bar.| |

print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});

Replies are listed 'Best First'.
Re^3: extracting lines from a string - while ignoring the \n character
by erroneousBollock (Curate) on Oct 30, 2007 at 02:04 UTC
    That's fine if you're sure that '.' == EOL is what the OP meant, but that's not clear to me.

    Maybe I misunderstood, but it seemed to me like the OP wants to distinguish between what s/he perceives to be two kinds of newline.

    -David