evening,
I hope you can help me.
I've got the following hash:
I need to sort the above has so that it prints out the $e_dat_name in alphabetical order, but still keeps it associated with $file.
Does anyone have any tips on how to go about this?
I've exhausted myself for days now trying different sort routines, one of which ended up like this:
$sortede_dat_name = sort { lc($sorte_dat_name{$a}) cmp lc($sorte_dat_name{$b}) }
%sorted_results = ("$sortede_dat_name","$sortfile");
}But no joy. Can anyone please put me out of my misery?
Thankyou very much for your help.
Rgds,
Wiliam Stephens
I hope you can help me.
I've got the following hash:
Code:
%sort_results = ("$e_dat_name","$file");Does anyone have any tips on how to go about this?
I've exhausted myself for days now trying different sort routines, one of which ended up like this:
Code:
while (($sorte_dat_name,$sortfile,) = each(%sort_results)) { $sortede_dat_name = sort { lc($sorte_dat_name{$a}) cmp lc($sorte_dat_name{$b}) }
%sorted_results = ("$sortede_dat_name","$sortfile");
}
Thankyou very much for your help.
Rgds,
Wiliam Stephens