#!/afs/sipb/project/perldev/p -w

use strict;

use vars qw( %htag );

while (<>) {
  next unless /\S/;
  my ($type, $tag, $host) = split(/\s+/, $_, 4);

  ($type eq '+') && (exists $htag{$host}&& print("$htag{$host} disappeared\n"),
		     $htag{$host} = $tag, next);
  ($type eq '-') && (delete($htag{$host}), next);
  ($type eq 'E') && (print("$tag error\n"),
		     delete($htag{$host}), next);
  ($type eq 'L') && (print("$tag logout\n"),
		     delete($htag{$host}), next);
  die "type $type!\n";
}

foreach (values %htag) { print("$_ unreclaimed\n"); }
