|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re^10: Pre vs Post Incrementing variablesby JavaFan (Canon) |
| on Sep 13, 2010 at 09:02 UTC ( [id://859956]=note: print w/replies, xml ) | Need Help?? |
|
Uhm, there's only one variable here, $n. Note that $n is returned, not "the value of $n". Preincrement ++ behaves just like += 1 in this respect.Correct. It doesn't. It returns $n after the first preincrement has been evaluated and $n after the second preincrement has been evaluated.But, $n_after_the_first_increment would be different, by 1, to $n_after_the_second_increment, but your own output--in both the relevant case and your two fantasy cases--shows both digits are the same.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||