in reply to exclamation mark
Since i'm here i thought i'd look at lower casing the non-first characters of words in a string. These aren't as useful a method as ucfirst lc for general cases, but they seem interesting and i wanted to play some golf (sorry, i'll try to control myself next time ;-).
-or-print join ' ', map { $_{w}=0; join '', map { ++$_{w} == 1 ? $_ : chr( (ord)+(1<<5) ) } split '' } split;
There are (much) better ways to do this, but these are the first that come to mind for obfuscation (and they run under strict and -w). You'll probably want to tweak for your style of coding...# If you wanted to stay away from push you could also write: $_[$#_+1] +=$_ s/(.)(.*)/$1 . lc($2)/e and push @_,$_ for split; print "@_$/";
Hope That Helps,
jynx
|
|---|