Perl: the Markov chain saw | |
PerlMonks |
Re^2: Split string using regex on \n or max line length (updated)by flowdy (Scribe) |
on Feb 10, 2017 at 09:11 UTC ( [id://1181641]=note: print w/replies, xml ) | Need Help?? |
Update: The following modification to the regex eliminates the need for the s/\s+$// for @lines; above (works because \s includes newline): I still plead for keeping the \W, best with non-greedifier i.e. \W?, so a final punctuation or hyphen is captured even though the limit is exceeded by one.
In Section
Seekers of Perl Wisdom
|
|