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).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: What makes an array sorted and a hash unsorted?
by Roy Johnson (Monsignor) on Jun 01, 2009 at 18:45 UTC | |
by ikegami (Patriarch) on Jun 01, 2009 at 19:23 UTC | |
by Roy Johnson (Monsignor) on Jun 01, 2009 at 20:10 UTC | |
by herveus (Prior) on Jun 05, 2009 at 14:08 UTC | |
by BrowserUk (Patriarch) on Jun 05, 2009 at 15:07 UTC | |
by tye (Sage) on Jun 05, 2009 at 15:29 UTC | |
|
In Section
Meditations