
use strict 'vars';
my %is_open;        
while (<>) {
  chomp;
  my ($who, $action, $how_much) = split;
  unless ($is_open{$who}) {
    open $who, ">>", $who
      or die "Couldn't open file for $who: $!; aborting";
    $is_open{$who} = 1;
  }
  print $who "$action $how_much\n";
}







