in reply to Re: 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

thanks for the quick reply. however, I didn't really get much use from your code. I read the thread about cmd.exe turning  'print $something;' into "'print" "$something;'" but what's your code supposed to do?

Replies are listed 'Best First'.
Re^3: same script acts differently when run as a file vs one-liner
by AnomalousMonk (Archbishop) on Jul 25, 2012 at 13:59 UTC
    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.

Re^3: same script acts differently when run as a file vs one-liner
by Anonymous Monk on Jul 25, 2012 at 11:06 UTC

    thanks for the quick reply. however, I didn't really get much use from your code. I read ... but what's your code supposed to do?

    Well, its supposed to show you the same thing the other thread showed, what reaches perl and how -- that's of no use?

      well, by that I meant I didn't understand it well. thanks for your replies.