uwc: perl version
authorRichard Kojedzinszky <krichy@cflinux.hu>
Thu, 25 Sep 2014 20:53:35 +0000 (22:53 +0200)
committerRichard Kojedzinszky <krichy@cflinux.hu>
Thu, 25 Sep 2014 20:53:35 +0000 (22:53 +0200)
uwc.pl [new file with mode: 0644]

diff --git a/uwc.pl b/uwc.pl
new file mode 100644 (file)
index 0000000..e6b4176
--- /dev/null
+++ b/uwc.pl
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+
+use common::sense;
+my %counts;
+
+while (<STDIN>) {
+       for (/([a-z']+)/goi) {
+               $counts{$1}++;
+       }
+}
+
+print join("\n", sort { $counts{$a} <=> $counts{$b} } keys %counts) . "\n";