sub namecase { my(@names) = @_; s/(\w+)/\L\u$1/g for @names; return @names; } # For example: print join "\n" => namecase('RONNIE NUNN', 'RON OLESIAK'); print "\n";
That works because the \L says "all lowercase", and the \u says "next letter uppercase".
In reply to Re: Converting letters from uppercase to lowercase.
by wog
in thread Converting letters from uppercase to lowercase.
by Perl Newby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |