in reply to How do i capitalise sentences?

while (<>) { $_ = ucfirst; s/([!.?])(\s+)(\w)/$1$2\U$3/g; print; }
revision: lhoward's right in that it should be \s* instead of \s+.