in reply to Re: RFC - FAQ for Modification of a read-only value attempted
in thread RFC - FAQ for Modification of a read-only value attempted

Indeed; for never iterates over an array. for always iterates over a list.

Doesn't this suggest that for iterates over the array, rather than over a list generated from the array?

c:\test>perl -wle"@a = 'a'..'f'; for( @a) { ++$_ }; print qq[@a]" b c d e f g

Maybe this is semantics, but I'd like to understand.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: RFC - FAQ for Modification of a read-only value attempted
by Anonymous Monk on Aug 29, 2006 at 13:38 UTC
    No.
    C:\>perl -wle"my $bar = 'NN';my @foo = 'b'..'c';for ( $bar, @foo ){ ++ +$_ } print qq! $bar @foo!" NO c d C:->