for my $a (@foo) { if ($a->[0] eq 'bill') { $a->[1] += 3; # add 3 to second field $a->[2] .= "!"; # add ! to third field } }