in reply to Re: (MeowChow) Re2: Look ahead and join if the line begins with a +
in thread Look ahead and join if the line begins with a +
I based my code on japhy's solutions, none of which were stripping newlines, probably because Rhodium didn't specify if he wanted them removed, or the lines to be simply concatenated as-is into single list items.
$lines[ @lines + 1 - s -^\053|\012--g ] .= $_ while <DATA>;This fails by adding an undef element to the array if a newline is not the final character in the file. Changing my original easy enough though, without any regex or substr nastiness:
chomp, $lines[@lines - s/^\+//] .= $_ while <DATA>;
MeowChow s aamecha.s a..a\u$&owag.print
In Section
Seekers of Perl Wisdom