team_1, location_2, tool_1, 4 team_3, location_1, tool_3, 3 team_2, location_3, tool_3, 2 team_2, location_4, tool_2, 5 team_2, location_4, tool_5, 3 #### location_4 tool_2 5 tool_5 3 #### (my $team, my $loc, my $tool, my $amt) = (split /[,]/)[1,2,3,4]; $status{$team}{$loc}{$tool}{amt} = $amt;