in reply to Count and List Items in a List
Assuming you get "results.txt" into an array, "@lists":
And the hash "%counts" will contain the item as a key and its count as the key's value. This is really a short version of the first post, but map is a neat function :). pFmy %counts = (); map {$counts{$_}++} @list;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Count and List Items in a List
by ikegami (Patriarch) on Nov 01, 2005 at 16:16 UTC | |
by Tanktalus (Canon) on Nov 01, 2005 at 17:51 UTC |
In Section
Seekers of Perl Wisdom