Same result on 5.12.0. On Sat Apr 21 23:30:11 2001, simon@netthink.co.uk wrote: > % ./perl -le '$a=do xa for ax;' > % ./perl -le 'do "xa" for ax;' > % ./perl -le 'do xa for ax;' > Missing $ on loop variable at -e line 1. > % ./perl -le 'do xa for "ax"' > % ./perl -le 'do xa for sin(1)' > Missing $ on loop variable at -e line 1. > % ./perl -le 'do xa for (sin(1))' > > Get this: > % ./perl -le 'do xa for "sin"' > % ./perl -le 'do xa for qq(sin)' > Missing $ on loop variable at -e line 1. > % ./perl -le 'do xa for my $a' > % ./perl -le 'do xa for my @a' > Missing $ on loop variable at -e line 1. > > The "Missing $" only happens for package/do/require/use followed by > bareword, and no other builtins, and where 'for' is followed by > anything other than /[$%@("']/ or my/our $foo. > > I can't see how it's getting that, because allowing "my" and "our" > with > a scalar suggests it's parsing "for" as the beginning of a statement, > but "for @a" is not allowed at the beginning of a statement, and > Deparse > reports: > % ./perl -Ilib -MO=Deparse -le 'do xa for my $a' > > foreach $_ (my($a)) { > do 'xa'; > } -- Alexandr Ciornii, http://chorny.netThread Previous