Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I just tried the following code...which is a variation on what you show.
It prints the following:
This is exactly what I believe the Camel says it should do since the loop variable is, if I recall correctly, always created anew as a lexical whose scope is the subsequent loop block (even though it appears to be created before the loop block). The output above seems to confirm that. I, like BrowserUk, however am a bit perplexed by the inability to use the $i[0] construct as the loop variable. Is it because the $i[0] implies a list structure which does not get created (via, for example, autovivification...spelling?)?
ack
Albuquerque, NM
In reply to Re^6: Hard syntax error or disambiguable parsing?
by ack
|
|