This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

knarf

By: a guest on Mar 1st, 2009  |  syntax: Perl  |  size: 0.16 KB  |  views: 87  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. open $file, 'test.txt';
  2. map {$freq{lc $_}++} split for <$file>;
  3. for $word (sort {$freq{$b} <=> $freq{$a}} keys %freq) {
  4.     print "$word: $freq{$word}\n";
  5. }
clone this paste RAW Paste Data