Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

History Meme, in Perl!

by defyance (Curate)
on Apr 11, 2008 at 18:07 UTC ( [id://679801]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|h
    +ead
    
  2. or download this
    history | perl -le 'while($l = <>) {$n=${[split(/\s+/,$l)]}[2];$h{$n}++;} $i=0;foreach $k (reverse sort {$h{$a}<=>$h{$b}} keys %h) {last if $i > 9; print "$h{$k} $k"; $i++;}'
  3. or download this
    history | perl -le 'while($l = <>) {$n=${[split(/\s+/,$l)]}[2];$h{$n}+
    ++;} $i=0;@a=reverse sort {$h{$a}<=>$h{$b}} keys %h; print "$h{$a[$_]}
    + $a[$_]" for (0..9)'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://679801]
Approved by rhesa
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-24 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found