P is for Practical | |
PerlMonks |
Re^3: Strange aliasing(?) when modifying variable in range operatorby LanX (Saint) |
on Jun 09, 2018 at 18:19 UTC ( [id://1216266]=note: print w/replies, xml ) | Need Help?? |
You're welcome! :) NB: You have no guaranty at all when INSIDE the statement the increment happens, it's only guarantied AFTER the statement. Most probably is Perl doing internal optimizations here. Your do-block examples puzzle me, please note the difference between debugger and one-liner
again, unpredictable internal optimization. If interested, you could use B::Concise to track what is happening here... So Rule Of Thumb: NEVER mix $i and $i++ (or --$i) inside the same statement.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|