in reply to time accumulater

It would help if you provided sample data, but one problem I see with your algorithm is that if $tmin or $tsec are 120 or more, your rollovers won't work.

You might also check out Time::Piece or Time::Local...although I'm guessing this is homework, and that would be cheating. :-)

Update: actually, as long as the times are standard (i.e. you don't have something like 2:45:152), you can ignore what I said about the rollovers not working (although you should roll your seconds over before your minutets, as fergal suggested). But the big reason your code isn't working is that you're referencing $fields[4] when I suspect you mean $lines[4]. Of course, if you ran with -w or use warnings and use strict, you would have caught this yourself.

Brad