How can I capitalize the first letter of each word in a string in Perl?
What is the easiest way to capitalize the first letter in each word of a string? piCookie See the faq . I don't believe ucfirst() satisfies the OP's question to capitalize the first letter of each word in a string without splitting the string and joining it later. Pat As @brian is mentioning in the comments the currently accepted answer by @piCookie is wrong! $_="what's the wrong answer?"; s/\b(\w)/\U$1/g print; This will print "What'S The Wrong Answer?" notice the wrongly capitalized S As the FAQ says you are probably better off using s/([\w']+)/\u\L$1/g or Text::Autoformat Take a look at the