danilobellini

Less lines of code: Perl

Jun 20th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.29 KB | None | 0 0
  1. #!perl -F\. -aln
  2. BEGIN { @ARGV = ("massa.txt") }
  3. $s{$F[-1]}++ }
  4. { printf "%3d %s\n", $s{$_}, $_ for sort {$s{$b} <=> $s{$a}} keys %s
  5.  
  6. # Based on http://pastebin.com/aU0w39QK and
  7. # https://www.facebook.com/pythonbrasil/photos/a.582882565067606.1073741825.328258703863328/776054062417121/
Advertisement
Add Comment
Please, Sign In to add comment