in reply to Updated code...
in thread Making a title/headline

Here's is more updated code, definitely better, in that it actually works on the first word, now I need it to work in the loop.

sub make_a_title { my @nocapslist = ( 'in', 'and', 'the', 'for', 'it', 'but', 'to', 'with', 'about', 'or', 'nor', 'because', 'as', 'that' ); my @wordlist = split (/\s+/, $_[0]); $wordlist[0] =~ s/(\w+)/\u\L$1/g; print "@wordlist\n"; foreach $word (@wordlist) { unless (grep {$_ eq $word} @wordlist) { $word =~ s/(\w+)/\u\L$1/g; print $word; } return join(' ', @wordlist); } }

Kickstart