dReKurCe has asked for the wisdom of the Perl Monks concerning the following question:
This produces the incorrect time...ant insight appreciated. Thanks...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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: time accumulater
by bgreenlee (Friar) on Aug 06, 2004 at 16:29 UTC | |
|
Re: time accumulater
by fergal (Chaplain) on Aug 06, 2004 at 16:29 UTC | |
|
Re: time accumulater
by CountZero (Bishop) on Aug 06, 2004 at 17:32 UTC | |
|
Re: time accumulater
by VSarkiss (Monsignor) on Aug 06, 2004 at 17:41 UTC | |
|
Re: time accumulater
by ysth (Canon) on Aug 06, 2004 at 19:44 UTC | |
|
Re: time accumulater
by graff (Chancellor) on Aug 08, 2004 at 05:04 UTC |