http://www.perlmonks.org?node_id=43203


in reply to What is the best way to capitalize a string?

You can use uc or lc built-in functions to change case. If you wanto to change case of first character only, then use ucfirst or lcfirst functions.

$lower = "name"; $upper = "NAME"; print uc($lower),"\n"; ### This will print : NAME print lc($upper),"\n"; ### This will print : name print ucfirst($lower),"\n"; ## This will print : Name print lcfirst($upper),"\n"; ## This will print : nAME