>>Hashes have no internal sorting. However you can do sort keys when
getting data out but this wont but it in >>chronological order.
>>Best way is it use your 'count tag' idea. Unless someone else has a
better idea?
Use an ARRAY it will maintain the sequential order. If you have paired
data, th
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 25 May 2006 07:05
To: activeperl@listserv.ActiveState.com
Subject: Ordering HASH
> Hi
> I am trying to order the keys of a hash in the order it was added
> .i.e, I am adding elements in the hash one by one and I
On May 25, 2006, at 02:05, <[EMAIL PROTECTED]> wrote:
Hi
I am trying to order the keys of a hash in the order it was added
.i.e, I am adding elements in the hash one by one and I want the
printing of the hash in the same order
what should I do to get this happening
I thought of adding a coun
Hashes have no internal sorting. However you can do sort keys when getting data out but this wont but it in chronological order.
Best way is it use your 'count tag' idea. Unless someone else has a better idea?
I have to say 'ORDERING Hash' has to be the best email subject I've seen for a while :P
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 25 May 2006 07:05
To: activeperl@listserv.ActiveState.com
Subject: Ordering HASH
> Hi
> I am trying to order the keys of a hash in the order it was added
> .i.e, I am adding elements in the hash one by one and I
If you simply do a keys or values of a hash, the order of the set is not
predictable, and iirc perldoc explicitly advises against it.
Since you process the contents in order, why not just use an array?
[EMAIL PROTECTED] wrote:
Hi
I am trying to order the keys of a hash in the order it was added
[EMAIL PROTECTED] wrote:
> Hi
> I am trying to order the keys of a hash in the order it was added
> .i.e, I am adding elements in the hash one by one and I want the
> printing of the hash in the same order
> what should I do to get this happening
> I thought of adding a count tag to each key
> But