Why don't you just change the input record separator?
This will have trouble with abbreviations, but then again, so will yours...
use warnings; use strict; { local $/ = '.'; while (<DATA>) { s/\cM\cJ|\cM|\cJ/ /g; # clean up newlines (any OS) s/^\s+//g; # and leading spaces s/\s\s+/ /g; # and double spaces print "$_\n"; } } __DATA__ This is my first line. This is my second line. This is my third line. This is my fourth line. This is my fifth line. This is my sixth line. This is my seventh line. This is my eighth line. This is my ninth line. This is my tenth line.
In reply to Re: Perl Split
by thundergnat
in thread Perl Split
by Gavin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |