#!/usr/bin/perl -w # Title case except for some special words use strict; my %Exceptions = ( "and" => 1, "the" => 1, "or" => 1 ); while () { my @Results = map { ( defined ( $Exceptions{ $_ } ) ) ? $_ : ucfirst ( lc ( $_ ) ) } split ( /\s+/, $_ ); print join ( " ", @Results ) . "\n"; } __DATA__ red hot chili peppers by the way