#!/usr/local/apps/perl/bin/perl ############################################################################# # # # WHO: John L. Moreland # # # # WHAT: count # # # # WHY: Print the number of occurances of unique items in the list read # # from STDIN. # # # # WHERE: San Diego Supercomputer Center (SDSC) # # # # WHEN: Sat Sep 12 16:01:13 PDT 1998 # # # # HOW: PERL # # # ############################################################################# # Read from standard input until end-of-file (Control-D = EOF under UNIX) while ( chop( $line = ) ) { $unique{$line} += 1; } foreach $key ( sort keys %unique ) { print "$key = $unique{$key}\n"; }