Re: Sorting a hash to user needs

2009-07-08 Thread Chas. Owens
On Wed, Jul 8, 2009 at 15:09, "Alexander Müller" wrote: > 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"

Sorting a hash to user needs

2009-07-08 Thread Alexander Müller
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) } (