This will uc the beginning of sentences and take care of the pronoun 'I'. Sorry it won't handle proper nouns :).
#!/usr/bin/perl
use warnings;
use strict;
my $string = "HEY I WANT TO YELL EVERYTHING. MY MOTHER DID NOT pay ME
+ENOUGH ATTENETION";
$string = join '. ',map {ucfirst} (split(/\. /,lc($string)));
$string =~ s/\bi\b/I/g;
$string .= '.';
print $string;
UPDATE: Ahh... you can also repeat this to cover different ending punctuation.
$string = join '. ',map {ucfirst} (split(/\. /,lc($string)));
$string = join '? ',map {ucfirst} (split(/\? /,lc($string)));
$string = join '! ',map {ucfirst} (split(/\! /,lc($string)));
$string =~ s/\bi\b/I/g;
$string .= '.';
grep
|
Unix - where you can thrown the manual on the keyboard and get a command |