From: "Paul Johnson" <[email protected]>
> 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 are asking.
>
> Time effective for whom? If it's for you, take a look at
> https://metacpan.org/module/Tie::IxHash
>
> If you're talking about execution speed, go with the simple solution
> first and time and profile the solution before looking to optimise it.
> You may find that the simple solution is good enough.
>
> --
> Paul Johnson - [email protected]
> http://www.pjcj.net
Or you can also use Tie::Hash::Indexed.
>From its POD:
DESCRIPTION
Tie::Hash::Indexed is very similar to Tie::IxHash. However, it is
written completely in XS and usually about twice as fast as Tie::IxHash.
Octavian
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/