in reply to Re: Re: Incrementing a Hash Value
in thread Incrementing a Hash Value
Is it undefined, or does do this: $k = $i; $i++; $i = $k;
Both.
$i++ stores the old value, increases the value, and then sets the return value to the stored old value. Although that is true for all versions of Perl, its behaviour is not documented. Actually, it is documented, but wrong:
[...] increment or decrement the variable after returning the value. [...] -- perlopIt doesn't increment after returning. It increments first, and then returns the old value.
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Incrementing a Hash Value
by Abigail-II (Bishop) on Jun 14, 2002 at 15:51 UTC | |
| |
Re: Re: Re: Re: Incrementing a Hash Value
by marvell (Pilgrim) on Jun 14, 2002 at 15:42 UTC | |
by Abigail-II (Bishop) on Jun 14, 2002 at 15:53 UTC | |
by marvell (Pilgrim) on Jun 14, 2002 at 16:30 UTC | |
by Abigail-II (Bishop) on Jun 14, 2002 at 16:34 UTC | |
by Sifmole (Chaplain) on Jun 14, 2002 at 16:37 UTC | |
by marvell (Pilgrim) on Jun 14, 2002 at 16:41 UTC | |
|