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

Paul LeoNerd Evans leonerd at leonerd.org.uk
Tue Mar 27 11:42:29 BST 2007


On Tue, 27 Mar 2007 11:10:57 +0100
"Paul Makepeace" <paulm at paulm.com> 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

I can't see a perl where it does work...

# perl -e 'for qw(a b) { print }'
Missing $ on loop variable at -e line 1.


# perl -v

This is perl, v5.6.1 built for sun4-solaris-64int
...


# perl -e 'for qw(a b) { print }'
Missing $ on loop variable at -e line 1.

# perl -v

This is perl, v5.8.0 built for sun4-solaris
...


-- 
Paul "LeoNerd" Evans

leonerd at leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/


More information about the london.pm mailing list