#!/afs/athena/contrib/perl/p

print "Hello\n";
open (LOG, "last|");
while (<LOG>) {
  if (/^(\w+).*\((..):(..)\)/o) {
    $who{$1} += $3 + (60 * $2);	
  }
}
print "Who       how long\n";
format =
@<<<<<<<<<< @>>>>
$name,$time
.
$name = "x";
for $foo (%who) {
  if ($name eq "x") {
    $name = $foo;
  } else {
    $time = sprintf ("%2d:%02d", $foo/60, $foo%60);
    write;
    $name = "x";
  }
}



