in reply to Re^6: String sorting in Perl
in thread String sorting in Perl
(Or you also could chomp the data before.)for my $line (sort { length $a <=> length $b || $count_hash{$b} <=> $c +ount_hash{$a}} keys %count_hash) { chomp $line; print "$line\t$count_hash{$line}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: String sorting in Perl
by markdavis87 (Novice) on Jun 04, 2014 at 19:47 UTC |