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