in reply to each() function used in associative arrays gives incorrect unordered output.

I think the issue is in the last statement made in the post.
In the code sample provided an array is NOT created at
any point. The hash ( associative array ) is named array, but
it is a hash. It might be simply a misunderstanding that
the code sample isn't creating an array. In looking at it
from this angle I can see where someone might expect the
the results to be in the same order. That is thinking that
an array has been created because we didn't use the more
traditional '=>' creation method.
  • Comment on Re: each() function used in associative arrays gives incorrect unordered output.

Replies are listed 'Best First'.
Re: Re: each() function used in associative arrays gives incorrect unordered output.
by Juerd (Abbot) on Jan 19, 2002 at 21:59 UTC
    I don't know if "array" in "associative array" implies order, but the name "associative array" was used in perl 4. Ever since the introduction of perl 5, the thing's called "hash". (Correct me if I'm wrong)

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$