![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: Iterator to parse multiline string with \\n terminatorby Athanasius (Bishop) |
on Oct 07, 2013 at 03:20 UTC ( #1057212=note: print w/replies, xml ) | Need Help?? |
Not quite. Putting \\\n into a character class causes every occurrence of either a backslash or a newline to be removed. This results in a file consisting of just a single line, which is not what is wanted. Remove the character class:
Output:
Note that the substitution operates on each line of input in turn, and a single input line can contain no more than one backslash-newline sequence. So, the /g modifier is not needed. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|