my %hash; my ($name,$time); while (@array) { $time = pop @array; $name = pop @array; $hash{$name} += $time; }