You don't show us your data, but my guess is, that your data has a space after every fullstop. Of course, when you don't have anything to discard, you could simply avoid the split and just match what you want to keep:
use strict; while (my $xline = <DATA>) { chomp $xline; my @sentences = ($xline =~ /(.*?(?:\.|$))\s*/g); print "---\n"; print "$_\n" for @sentences; print "---\n"; }; __DATA__ First line. Second line. Third line. Fourth line. Fifth line
In reply to Re: Perl Split
by Corion
in thread Perl Split
by Gavin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |