I am relatively new to Perl. Here is the line of code that I have written.It returns key value pairs that I use for further processing. However, I want it to return the pairs in a sorted list (sorted by the keys)
while(($key, $value) = each %hash)
{
...
}
Is there any way in which I can sort the hash within this line or separately before executing this line of code.
Your help is greatly appreciated.
while(($key, $value) = each %hash)
{
...
}
Is there any way in which I can sort the hash within this line or separately before executing this line of code.
Your help is greatly appreciated.