Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-24 Thread Dr.Ruud
On 23/04/2013 13:26, kavita kulkarni wrote: Can you help me in finding the most time effective way to retrieve the key-values from hash in the same sequence in which data is inserted into the hash. But why would you want that? You can push the keys in an array as well. But you will often have

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread kavita kulkarni
Let me try this way as well. (using array) Will compare the results with the solution I have implemented and will continue with the one which is faster. :) Thanks for all your responses!! Regards, Kavita :-) On Wed, Apr 24, 2013 at 4:12 AM, John Delacour wrote: > On 23/4/13 at 12:26, kavitahkul

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread John Delacour
On 23/4/13 at 12:26, kavitahkulka...@gmail.com (kavita kulkarni) wrote: Can you help me in finding the most time effective way to retrieve the key-values from hash in the same sequence in which data is inserted into the hash. What about this? : #!/usr/bin/perl use strict; my @array; for ( {

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread Andy Bach
On Tue, Apr 23, 2013 at 8:20 AM, kavita kulkarni wrote: > > I have prefixed keys with numbers & used hash sorting, that resolved the > issue. Hmm, why not an array of (e.g. anon. hashes) then? If you're creating them in order, just push them on an array - got to be cheaper than sorting hash ke

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread kavita kulkarni
Thanks All, I have prefixed keys with numbers & used hash sorting, that resolved the issue. Regards, Kavita :-) On Tue, Apr 23, 2013 at 6:14 PM, Octavian Rasnita wrote: > From: "Paul Johnson" > > > On Tue, Apr 23, 2013 at 04:56:55PM +0530, kavita kulkarni wrote: > >> Hello All, > >> > >> Can

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread Octavian Rasnita
From: "Paul Johnson" > On Tue, Apr 23, 2013 at 04:56:55PM +0530, kavita kulkarni wrote: >> Hello All, >> >> Can you help me in finding the most time effective way to retrieve the >> key-values from hash in the same sequence in which data is inserted into >> the hash. > > Hashes are unordered, s

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread John SJ Anderson
On Tue, Apr 23, 2013 at 5:31 AM, kavita kulkarni wrote: > The values I have stored in the hash should essentially be retrieved in > order, so normal retrieval is not a correct solution for me. > > I have tried using IxHash, but it takes much longer execution time than > expected. Any other solutio

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread kavita kulkarni
The values I have stored in the hash should essentially be retrieved in order, so normal retrieval is not a correct solution for me. I have tried using IxHash, but it takes much longer execution time than expected. Any other solution for this? Regards, Kavita :-) On Tue, Apr 23, 2013 at 5:11 PM

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread Owen
> Hello All, > > Can you help me in finding the most time effective way to retrieve the > key-values from hash in the same sequence in which data is inserted > into > the hash. Hashes are unordered, have a look at Tie::IxHash in CPAN, http://search.cpan.org/~chorny/Tie-IxHash-1.23/lib/Tie/IxHash

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread Paul Johnson
On Tue, Apr 23, 2013 at 04:56:55PM +0530, kavita kulkarni wrote: > Hello All, > > Can you help me in finding the most time effective way to retrieve the > key-values from hash in the same sequence in which data is inserted into > the hash. Hashes are unordered, so you cannot directly do what you

Re: how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread David Precious
On Tue, 23 Apr 2013 16:56:55 +0530 kavita kulkarni wrote: > Hello All, > > Can you help me in finding the most time effective way to retrieve the > key-values from hash in the same sequence in which data is inserted > into the hash. Normal hash ordering is unpredictably random. The Tie::IxHash

how to retrieve the keys from hash in the sequence in which data is inserted

2013-04-23 Thread kavita kulkarni
Hello All, Can you help me in finding the most time effective way to retrieve the key-values from hash in the same sequence in which data is inserted into the hash. Thanks in advance. Regards, Kavita