in reply to array problems
Build a hash keyed on the names, and add the times
The while (@array) condition remains true as long as @array is not empty. I use pop so that @array doesn't move. You may need to adapt if your time elements are formatted to exclude simple arithmetic.my %hash; my ($name,$time); while (@array) { $time = pop @array; $name = pop @array; $hash{$name} += $time; }
After Compline,
Zaxo
|
|---|