s/(\.\W+)(\w)/$1\u$2/g; #### open IN, "< infile" or die "couldn't open infile: $!"; undef $/; $_ = ; s/(?<=\n\s*)(\w)/\u$1/g; print OUT; #### s/(?<=\n\s*\n\s*)(\w)/\u$1/g;