Think about Loose Coupling | |
PerlMonks |
Re^3: File ext numberby ikegami (Patriarch) |
on Mar 19, 2010 at 23:54 UTC ( [id://829728]=note: print w/replies, xml ) | Need Help?? |
I guess I was without realizing it. Obviously, that's not true and my explanation is wrong. Take two: means something close to
Well, actually more like the following, but it doesn't matter for this discussion:
Either way, you are relying on Perl evaluating the RHS of the "+=" operator before its LHS, and that's not how Perl operates. In fact, Perl doesn't document how it operates in this circumstance, and that's the reason it's generally a no-no to change and use the same variable in the same expression. Even though my earlier explanation was wrong, the solutions I posted still avoid the problem. Update: Improved phrasing by inlining footnotes.
In Section
Seekers of Perl Wisdom
|
|