#!/usr/bin/perl

# Count number of unique rows.
# example: who | cut -d' ' -f1 | ./ucount.pl
# Andreas Henriksson <andreas@fatal.se>, 2007-05-31

use strict;

my %foo;

while (<>) {
	chomp;
	if ($foo{$_}) {
		$foo{$_}++;
	} else {
		$foo{$_} = 1;
	}
}

foreach (keys %foo) {
	print $foo{$_} . ":". $_. "\n";
}
