I can't reproduce your problem (on the W7 machine available right now).
C:\>perl -p -w -e "s/(\w+)/\u\L$1/;" # quoting changed from OP to obl +ige M$ foo Foo ....
Beyond that, and even though none of this is really on point:
In reply to Re: same script acts differently when run as a file vs one-liner
by ww
in thread same script acts differently when run as a file vs one-liner
by mavili
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |