while () { chomp; my @line = split /,/; my $name = shift @line; if (exists $servers{$name}) { foreach my $index (0..$#line) { $servers{$name}[$index] += $line[$index]; } } else { $servers{$name} = [@line]; } } #### cihcrppmon02,standard_unix_corp-cis_shared,1703995999752,133635610485,31055995112,12.75,54.8, ghnbu, gh_nbu02 ovpip02,standard_unix_corp-cis_shared,41851038572,14933570508,3835386732,2.80,10.91,ghnbu, gh_nbu02 cihcispapp247,standard_unix_corp-cis_shared,190635017908,24806407611,9442867181,7.68,20.19,ghnbu, gh_nbu02 wavmd003,standard_unix_corp-cis_shared,2760141244,594115253,299382152,4.65,9.22,ghnbu, gh_nbu02