fw's Journal
http://use.perl.org/~fw/journal/
fw's use Perl Journalen-ususe Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners.2012-02-08T17:47:58+00:00pudgepudge@perl.orgTechnologyhourly11970-01-01T00:00+00:00fw's Journalhttp://use.perl.org/images/topics/useperl.gif
http://use.perl.org/~fw/journal/
more commands!
http://use.perl.org/~fw/journal/40298?from=rss
<p>In reply to <a href="http://blog.afoolishmanifesto.com/archives/1318">fREW Schmidt</a>'s and <a href="http://blogs.perl.org/users/ovid/2010/04/meme.html">Ovid</a>'s top 10 history commands, here is my list:</p><blockquote><div><p> <tt>fw@hal2 ~<nobr> <wbr></nobr>:) % history -n 1 | awk {'print $1'} | sort | uniq -c | sort -k1 -rn | head<br> 13299 cd<br> 7846 ls<br> 7126 perl<br> 5755 vim<br> 3117 git<br> 2893 sudo<br> 1319 exit<br> 1134 lt<br> 977 rm<br> 817 perldoc</tt></p></div> </blockquote><p> <code>alias lt='ls -ltr'</code> </p><p>(this is from my eternal zsh history which started on Nov 4th, 2008)</p><p>-- Frank</p>fw2010-04-06T07:26:41+00:00journalFirst Perl6 program
http://use.perl.org/~fw/journal/38055?from=rss
This one reads STDIN, counts words (here words are things between whitespace), and prints them sorted in descending order by occurrence.<blockquote><div><p> <tt>my %words;<br> <br>$*IN.lines.split(/\s+/).map: { %words{$_}++ };<br> <br>for %words.pairs.sort: { $^b.value <=> $^a.value } -> $pair {<br> say $pair<br>}</tt></p></div> </blockquote><p> <small>see also: <a href="http://perlmonks.org/?node_id=729238">this node at perlmonks</a> </small></p>fw2008-12-09T21:43:07+00:00journal