use strict; use warnings; my $text = <){ chomp; s/[.!?]\K\s*/\n/g; print; } close $fn;