Hi,

I need an order for hash by user preferences. Because the criterion to order 
the hash entries a not numerical and not should sorted alphabetical, I tried 
following


  3 %hashToSort = (
  4     "a" => "one",
  5     "b" => "two",
  6     "c" => "three",
  7 );

@keys = sort { qw(a, b, c) } (keys %hashToSort);
 16     foreach $key (@keys) {
 17         print "$key -> $hashToSort{$key}";
 18         print "\n\n";
 19     }

but this didn't work. 

The criterion are string entries of the hash keys.

I don't want to work with Tie::IxHash. 

Did I make a syntactical mistake?

Thanks.

Alex


Reply via email to