mavili has asked for the wisdom of the Perl Monks concerning the following question:
that works fine. as you can guess, it upcases the first letter of the word entered. however, when I run this one-liner in cmd:while(<>){ s/(\w+)/\u\L$1/; print; }
it just prints the word, with no change (it doesn't capitalize it). they should do the same things, shouldn't they??perl -p -w -e 's/(\w+)/\u\L$1/'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: same script acts differently when run as a file vs one-liner
by ww (Archbishop) on Jul 25, 2012 at 11:19 UTC | |
|
Re: same script acts differently when run as a file vs one-liner
by Anonymous Monk on Jul 25, 2012 at 10:43 UTC | |
by mavili (Initiate) on Jul 25, 2012 at 10:58 UTC | |
by AnomalousMonk (Archbishop) on Jul 25, 2012 at 13:59 UTC | |
by Anonymous Monk on Jul 25, 2012 at 11:06 UTC | |
by mavili (Initiate) on Jul 28, 2012 at 18:39 UTC |