http://qs321.pair.com?node_id=767344


in reply to Re^5: What makes an array sorted and a hash unsorted?
in thread What makes an array sorted and a hash unsorted?

So hashes aren't ordered because the following doesn't work?

$h{foo} = 'a'; $h{bar} = 'b'; $h{baz} = 'c'; is(join(' ', values(%h)), "a b c");

I guess arrays aren't ordered either, then.

$a[2] = 'a'; $a[0] = 'b'; $a[1] = 'c'; is("@a", "a b c");

Order has to be imposed externally on the data in the case of arrays too. It's just there's a convenient way of doing that when the keyspace isn't sparse (namely, the range operator).