RE: Ordering HASH

2006-05-25 Thread Bullock, Howard A.
>>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

RE: Ordering HASH

2006-05-25 Thread Brian Raven
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

Re: Ordering HASH

2006-05-25 Thread DZ-Jay
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

Re: Ordering HASH

2006-05-25 Thread David Burdon
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

RE: Ordering HASH

2006-05-25 Thread Brian Raven
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

Re: Ordering HASH

2006-05-25 Thread Foo Ji-Haw
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

Re: Ordering HASH

2006-05-25 Thread $Bill Luebkert
[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