Perl: the Markov chain saw | |
PerlMonks |
Re^6: Hard syntax error or disambiguable parsing?by ack (Deacon) |
on Jan 29, 2009 at 16:17 UTC ( [id://739952]=note: print w/replies, xml ) | Need Help?? |
AhHa! In my earlier comment on one of the other threads, I had forgotten that the loop variable is not only lexical and in-scope in the loop's block, but that it is also aliased to the iterator. Thanks GrandFather. I learn so much (sometimes mulitiple times since I am frequently not a very memory-rich Pilgrim) from the Monestary. I am curious, however. Since the loop variable is aliased to the iterator (or to the iterator's values?); how does that work when the iterator doesn't appear to have variables, but rather constants (as in the case this thread is addressing (i.e., the (0..5) iterator)? And what would happen if you tried to change the iterator loop variable within the loop block> By way of an example of that last question:
Actually I can answer that myself by trying it. No need to answer that part of the question; I don't want to abuse the Monks with things I can easily do my self. But the question before that last one is still nagging me.
ack
Albuquerque, NM
In Section
Seekers of Perl Wisdom
|
|