Hamish Whittal wrote:

Hi all,

I have a hash and want to return the first key in the hash. How can I do
this?


The answer is (keys (%your_hash))[0]. This will return the first element in the list of hash keys returned by keys. But, you can never be sure of the order in which the keys will be retrieved. If you are worried about the order, take a look at the Tie::IxHash module.



Thanks in advance,


Hamish







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



Reply via email to