in reply to New to Perl, getting funny results when sorting an Array
Here's one mistake:
@hwall = keys %average; @hwall = sort (%average);
What you probably meant was:
@hwall = keys %average; @hwall = sort { $average{$a} <=> $average{$b} } @hwall;
...at least that is if I understand your intent. I may have misunderstood it, making my solution in error, but the second line I pointed out definately is a bug. ;)
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: New to Perl, getting funny results when sorting an Array
by eibwen (Friar) on Apr 13, 2005 at 07:08 UTC |