in reply to Re: String sorting in Perl
in thread String sorting in Perl
Ah! I got it.
my @sorted_data = sort { length $a <=> length $b || $count_hash{b} <=> + $count_hash{$a} } keys %count_hash;
should be
my @sorted_data = sort { length $a <=> length $b || $count_hash{$b} <= +> + $count_hash{$a} } keys %count_hash;
We were just missing a "$" before the "b"...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: String sorting in Perl
by Laurent_R (Canon) on Jun 04, 2014 at 18:26 UTC | |
by markdavis87 (Novice) on Jun 04, 2014 at 18:29 UTC | |
by Laurent_R (Canon) on Jun 04, 2014 at 18:47 UTC | |
by markdavis87 (Novice) on Jun 04, 2014 at 18:54 UTC | |
by Laurent_R (Canon) on Jun 04, 2014 at 19:06 UTC | |
| |
by markdavis87 (Novice) on Jun 04, 2014 at 19:06 UTC |