(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"; }
In reply to Re^7: String sorting in Perl
by Laurent_R
in thread String sorting in Perl
by markdavis87
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |