Skip to content

Commit 682e9b8

Browse files
committed
Damn useful script that I want online somewhere
1 parent c72b86b commit 682e9b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts4java/reportcount.pl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/perl
2+
3+
sub numerically { $a <=> $b; }
4+
5+
while(<>) {
6+
$report{$_} = $report{$_} + 1;
7+
}
8+
9+
while( ($key,$value) = each(%report) ) {
10+
push @report, ("$value - $key");
11+
}
12+
13+
$"="\n";
14+
15+
print reverse sort numerically @report;

0 commit comments

Comments
 (0)