#!/usr/sup/gnu/bin/perl -000 $threshold = 1; while ($_ = shift) { if ($_ eq '-t') { $threshold = shift; } else { die "Usage: $0 [ -t ]\n"; } } while (<>) { s/(\w)-\n\s*(\w)/$1$2/g; tr/A-Z/a-z/; tr/ \t\r\n(),.;:/ /s; foreach (split(/\s+/)) { $count{$_}++ if /^[\w'-]*\w[\w'-]*$/; } } foreach (sort keys %count) { if ($count{$_} > $threshold) { $totalt += $count{$_}; write; } } print "\n"; $count{$_ = "Totalt"} = $totalt; write; format top = Ord Antal gånger ------------------------------- . format = @<<<<<<<<<<<<<<<< @<<<<<<<< $_, $count{$_} .