C:\>perl -p -w -e "s/(\w+)/\u\L$1/;" # quoting changed from OP to oblige M$ foo Foo ....