in reply to Re: Incrementing a Hash Value
in thread Incrementing a Hash Value

It's a common mistake to assume that it works this way. And with some compilers and some versions of Perl it will work on some platforms for some values of the hash. But in other cases, pink monkeys may fly out of your nose, your dog may die and your piano suddenly walks away.

The behaviour of $i = $i ++ in all its variants is undefined. Anything could happen.

Abigail

Replies are listed 'Best First'.
Re: Re: Incrementing a Hash Value
by Juerd (Abbot) on Jun 14, 2002 at 13:09 UTC

    And with some compilers and some versions of Perl it will work on some platforms for some values of the hash.

    Compilers and platforms have absolutely nothing to do with the order in which Perl walks its ops.

    Perl code (code written in Perl) is not compiled by a C compiler.

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.
    

A reply falls below the community's threshold of quality. You may see it by logging in.