in reply to Re^2: map confusion
in thread map confusion

Let's say you have a variable $A and you do this:
$A = 5; $B = $A++; print $A; # prints out 6. $B is 5
$A = 5; $B = ++$A; print $A; # prints out 6. $B is 6
$A = 5; $B = $A*2; print $A; # prints out 5. $B is 10
$A = 5; $B = $A+1; print $A; # prints out 5. $B is 6


Because ++ changes the original AFTER the operation, and mutiplication just returns the result, without modifying the original.