#!/usr/bin/perl while (<>) { @words = split(/\n+/); foreach $word (@words) { $count{$word}++; } } foreach $word (sort by_count keys %count) { print "$word \: $count{$word}\n"; } sub by_count { $count{$b} <=> $count{$a}; }
In reply to Re^2: Reporting entries in a file
by SkullOne
in thread Reporting entries in a file
by SkullOne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |