in reply to Hard syntax error or disambiguable parsing?

Suppose it could be done. What should the following do:
my @a = qw [a b c]; for $a[7] (1 .. 5) { 1; # Body not important. } say 0 + @a;

Replies are listed 'Best First'.
Re^2: Hard syntax error or disambiguable parsing?
by BrowserUk (Patriarch) on Jan 29, 2009 at 20:22 UTC

    It would operate the same as this, but without the need to re-state the loop variable 3 times:

    #! perl -slw use strict; my @a = qw [a b c]; for( $a[7] = 1; $a[ 7 ] <= 5; ++$a[7] ) { print $a[ 7 ]; } print 0 + @a; print "@a"; __END__ C:\test>junk2.pl 1 2 3 4 5 8 Use of uninitialized value in join or string at C:\test\junk2.pl line +10. Use of uninitialized value in join or string at C:\test\junk2.pl line +10. Use of uninitialized value in join or string at C:\test\junk2.pl line +10. Use of uninitialized value in join or string at C:\test\junk2.pl line +10. a b c 6

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.