in reply to Re^2: same script acts differently when run as a file vs one-liner
in thread same script acts differently when run as a file vs one-liner

perl -p -w -e 's/(\w+)/\u\L$1/'

mavili: What Anonymonk (and, in particular, the given link – did you take a look at it?) wanted to point out is that you are not using the proper command line argument quoting for the Windows command line processor (single-quotes would be appropriate for *nix). Try either
    perl -p -w -e "s/(\w+)/\u\L$1/"
(using double-quotes) or, because there are no embedded spaces in the CLI argument and thus no need for quotation, simply
    perl -p -w -e s/(\w+)/\u\L$1/
instead.