foreach $linex(@lines0){ @lines=split(/ /,$linex); $time=$fields[4]; @units=split(/:/,$time); $sec=$units[2]; $min=$units[1]; $hrs=$units[0]; $tsec+=$sec; $tmin+=$min; $thrs+=$hrs; if ($tmin>60){ $rolloverm=$tmin%60; $tmin=$rolloverm; $thrs+=1; } if ($tsec>60){ $rolloverm=$tmin%60; $thrs+=1; } print "Total time is $tmin minutes and $tsec seconds\n";