in reply to Re: Parsing multiline string line by line
in thread Parsing multiline string line by line
Note that this will remove LF in the end of the strings, but not CR, so if newlines in DOS format you will have CR in the end of the line, and it wouldn't work with old Mac strings at all. I personally prefer the following variation:
for (split /^/, $str) { ... }
It works just like while (<>)
Updated: fixed, thanks to ikegami
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parsing multiline string line by line
by ikegami (Patriarch) on Feb 19, 2009 at 14:40 UTC |