Peter:

I am not sure how I can differ or accept your statement, which is sort of
appealing to me. Let me run this by you. On querying a database, I am
getting a recordset of this form:

2001-10-01 01:00:00     Amy          10    20    normal   555.234
2001-10-01 01:00:00    JoeDoe    15    25    high        623.456
2001-10-01 01:00:00    RexArul    10    20    high        772.265
2001-10-01 02:00:00    Amy           10    20    high        544.345
2001-10-01 02:00:00    JoeDoe    15    25    high        689.52
2001-10-01 02:00:00    RexArul     10    20    high        800.002

As you could see the recordset is sorted by Date-Timestamp first and then by
the user-names second in the database. This is how the recordset is handed
out to my ASP Page. I slash the records into a hash with Date-Timestamp and
user-names being my hash keys (HashOfHashOfArrays):

Like this:

$returnHash->{getDTS($objRS->Fields(0)->{Value})}{$objRS->Fields(1)->{Value}
} =
                                [$objRS->Fields(2)->{Value},
$objRS->Fields(3)->{Value},$objRS->Fields(4)->{Value},$objRS->Fields(5)->{Va
lue}];

Now as you see the date-timestamp and usernames, both are not going to lose
their already sorted order from the database. Please shed some ideas as to
how this is would be construed as mismodelling.

Thanks in advance,
--Rex

----- Original Message -----
From: "Peter Scott" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Rex Arul" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 23, 2001 1:45 AM
Subject: Re: Maintaining Order of Keys in a Hash


> At 09:52 PM 10/22/01 -0400, Jeff 'japhy' Pinyan wrote:
> >On Oct 22, Rex Arul said:
> >
> > >Without resorting to any additional lists/arrays, how can I maintain
the
> > >order of the keys in a hash? Is there a "package/module" that would
redress
> > >this issue?
> >
> >Tie::IxHash, on CPAN.
>
> It should be said, if you care about the order of the keys in your hash,
it
> is far more likely that you have mismodelled your problem than that you
> need to use IxHash.
>
> --
> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to