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]); ucfirst ($wordlist[0]); foreach $word (@wordlist) { if (!grep {$_ eq $word} @wordlist) { ucfirst ($word); print $word; } return join(' ', @wordlist); } }