in reply to sorting text into sentences.

Using 'A zero-width positive look-ahead assertion' and 'A zero-width positive look-behind assertion.' in the split should do what you want. Read "perldoc perlre".
my $text; { local $/ = undef; open my $fh, 'file_name' or die "Damn $!"; $text = <$fh>; } $text =~ tr/\n/ /; my @arr = split /(?<=[.,;])\s*(?=[A-Z])/, $text; foreach (@arr) { print ':', $_, ":\n"; }