On Wednesday 12 March 2003 01:12, Joshua Hoblitt wrote:
> BUT...
>
> perl -ew '1?:1'
>
> No error???
>
> -J
The problem is that perl -ew is not the same as perl -we. When it's after the
-e, the w is taken as a piece of perl code eg try
perl -edie
or
perl -e'some fabby one-liner'
so
perl -ew '1?:1'
is actually the same as
perl -e 'w' '1?:1'
So your script is just the bareword w which is treated as a string when not in
strict mode. Try perl -w -ew to see a warning about it.
2 reasons for not requiring a space between -e and the perlcode you want to
execute are: it let's you knock off 1 character in a game of Perl golf and
that's the way it's always been so changing it could break existing
one-liners.
Would a warning be appropriate? The patch attached adds Perl warn
No space between -e and script body
when it occurrs, although the Perl golfers are definitely not going to like
that so I doubt this patch is going in,
F