Re: Sorting a hash with keys generated on the fly

2002-11-05 Thread Jenda Krynicky
From: "Scott, Joshua" <[EMAIL PROTECTED]> > I'd like to know the best/easiest way to sort a hash based on the > values of it's keys. Here is a snippet of my code. > > %somehash=(); > > foreach (@somearray) { > $somehash{$_}++; > }; > > Basically I'm getting a count of

Sorting a hash with keys generated on the fly

2002-11-05 Thread Scott, Joshua
I'd like to know the best/easiest way to sort a hash based on the values of it's keys. Here is a snippet of my code. %somehash=(); foreach (@somearray) { $somehash{$_}++; }; Basically I'm getting a count of unique items in an array and I want to sort by the number of each item. I've