#!/usr/bin/perl -w use strict; my @times = qw( 5:21 8:01 5:37 7:19 5:46 7:44 6:43 7:17 8:02 6:50 7:54 8:44 ); my $total_minutes; my $total_seconds; foreach my $time (@times) { my ($m,$s) = split(':',$time); $total_minutes += $m; $total_seconds += $s; } my ($h,$m,$s) = (gmtime($total_minutes*60+$total_seconds))[2,1,0]; print "$h hours, $m minutes, $s seconds"; #1 hours, 25 minutes, 18 seconds