my $text = lc($text); #### my $result; my $text = lc($text); my @words = split(/\s+/,$text); foreach(@words){ $result .= ucfirst($_)." "; }