I believe you can further reduce the code to:
perl -e 'my @a = qw(1:08 2:53 1:00); foreach(@a){($min, $sec)=split /: +/;$time+=( +$min*60)+$sec}; print int($time/60).":".(sprintf "%.2d", $time%60)."\ +n"'
It only saves six keystrokes; however, I do love the economy of your code.
Mike
In reply to Re^2: How to add minutes with seconds?
by bioMan
in thread How to add minutes with seconds?
by gube
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |