in reply to Case Munging
You could split on anything that wasn't an uppercase letter ([^A-Z]), capturing what you split on, do your ucfirst lc in a map then concatenate the results with join.
$ cat companies WOOLWORTHS CAP GEMINI AVIVA AMERADA HESS RUN4LIFE $ perl -pi.bak -e '$_ = join q{}, map { ucfirst lc } split m{([^A-Z]+) +};' companies $ cat companies Woolworths Cap Gemini Aviva Amerada Hess Run4Life $
I hope this is useful.
Cheers,
JohnGG
|
|---|