Len Walter wrote:
: Since the data is "string\n\rstring" I figured I could use split /^/ to 
: separate out the individual strings. There's probably an easier way to do it
: though... the split seems to work correctly, and both @strings and %content 
: get filled apparently ok.

Try splitting on /\n\r/ instead. /^/ actually matches the beginning of
a string *or*, with split or in matching with /m, right after a newline
(\n), without consuming any characters (it's an assertion). So if $data
is

        "Line one\n\rLine two"

then "split /^/, $data" gives

        Line one\n
        \rLine two

In other words, the \n\r is split and left attached to the pieces.

Splitting on /\n\r/ avoids this.

-- tdk

Reply via email to