From 3db12e8b236ac8f88db8eb4690d10e4a3b8dbcd4 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 16 Jan 1998 12:13:05 +0000 Subject: Initial revision git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/occur.pl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sample/occur.pl (limited to 'sample/occur.pl') diff --git a/sample/occur.pl b/sample/occur.pl new file mode 100644 index 0000000000..1f5fcf27a4 --- /dev/null +++ b/sample/occur.pl @@ -0,0 +1,9 @@ +while (<>) { + for (split(/\W+/)) { + $freq{$_}++; + } +} + +for (sort keys %freq) { + print "$_ -- $freq{$_}\n"; +} -- cgit v1.2.3