in reply to Re: pre v.s. post (increment/decrement)
in thread pre v.s. post (increment/decrement)
So, for your first line, you could get "2:2", or "2:1" and for the second line, you could get "1:2" or "1:1". Or some other weird value for the second $a.
As a rule, never use a variable you are pre- or post incrementing or decrementing a second time in the same statement. And most certainly, don't modify the variable a second time. The following is undefined:
meaning that if perl decides to erase your hard disk, it's still well inside the boundaries of its specification.my $i = 0; $i = ++ $i;
Abigail
|
|---|