New(?) for qw(...) error

Matt Lawrence matt.lawrence at virgin.net
Tue Mar 27 12:39:27 BST 2007


Dirk Koopman wrote:
> Paul Makepeace wrote:
>> I've just had one of my dodgier scripts start bailing on this 
>> construction,
>>
>> $ perl -le 'for $a qw(a b) { print $a }'
>> a
>> b
>> $ perl -le 'for qw(a b) { print }'
>> Missing $ on loop variable at -e line 1.
>>
>> This is on 5.8.8; not sure when this kicked in.
>>
>> P
>>
>
> $ perl -le 'for (qw(a b)) { print }'
> a
> b
>
$ perl -le 'print for qw( a b )'
a
b



More information about the london.pm mailing list