in reply to Re: loop surprise
in thread loop surprise
If I wanted a localized variable I write the loop as "for my $j (...)".
If I explicitly use "for $i" I make clear my intention of using a previously introduced variable.
Why perl then insists on knowing better and localizing it is counter-intuitive to me and at the moment I don't see any reason why it should be implemented like that (but there probably is one)...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: loop surprise
by golux (Chaplain) on Apr 03, 2018 at 15:10 UTC | |
by morgon (Priest) on Apr 03, 2018 at 18:00 UTC | |
by Your Mother (Archbishop) on Apr 03, 2018 at 18:21 UTC | |
by morgon (Priest) on Apr 03, 2018 at 20:50 UTC | |
by Your Mother (Archbishop) on Apr 04, 2018 at 00:38 UTC | |
by Skeeve (Parson) on Apr 04, 2018 at 10:02 UTC | |
| |
by BillKSmith (Monsignor) on Apr 04, 2018 at 04:18 UTC | |
|
Re^3: loop surprise
by LanX (Saint) on Apr 03, 2018 at 15:05 UTC |