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

Dirk Koopman djk at tobit.co.uk
Tue Mar 27 12:13:40 BST 2007


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


More information about the london.pm mailing list