in reply to Dear Monks
Replace <DATA> with "<>" to run it for real, and either pipe in the data file or pass the filename as an argument to the script.my %count; while(<DATA>) { chomp; tr/,/\t/; $count{$_}++; } foreach(sort keys %count) { print "$count{$_}\t$_\n"; } __DATA__ abcd,US abee,UK abcd,US adee,US
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |