in reply to same script acts differently when run as a file vs one-liner
cmd as in cmd.exe windows like me? See Re: 'perl -le' not working on the command line
$ perl -MO=Deparse -p -w -e 's/(\w+)/\u\L$1/' Useless use of a constant (s/(\w+)/\u\L$1/) in void context at -e line + 1. BEGIN { $^W = 1; } LINE: while (defined($_ = <ARGV>)) { '???'; } continue { die "-p destination: $!\n" unless print $_; } -e syntax OK $ perl -MData::Dump -e " dd\@ARGV " 's/(\w+)/\u\L$1/' ["'s/(\\w+)/\\u\\L\$1/'"]
See also perlrun, Behind the GUI lives the Shell and How Command Line Parameters Are Parsed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: same script acts differently when run as a file vs one-liner
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 |