ucfirst(lc($var)) will titlecase only the first word. Didn't know you wanted to do a whole sentence.
For a sentence, chazoid's solution works.
Or, combining the two: $var =~ s/\b(.*?)\b/ucfirst(lc($1))/eg;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.