Think about Loose Coupling | |
PerlMonks |
Re: Capitalize the 1st letter of each wordby Zaxo (Archbishop) |
on Jan 15, 2004 at 20:06 UTC ( [id://321655]=note: print w/replies, xml ) | Need Help?? |
A regex is best suited to altering the array in place s/(\w)(\w*)/\U$1\E$2/ for @array; You can use a regex, but to make a new array with initial caps, ucfirst is handier, my @arrayl = map {ucfirst} @array; The regex can also be applied to a string with the /g flag
After Compline,
In Section
Seekers of Perl Wisdom
|
|