$s =~ s/^((?![A-Z])[a-z]\w+)/ucfirst$1/e; $s =~ s/([.?!]\s*)((?![A-Z])[a-z]\w+)/$1.ucfirst$2/eg;