in reply to Re: How to add minutes with seconds?
in thread How to add minutes with seconds?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to add minutes with seconds?
by Anonymous Monk on Mar 15, 2006 at 23:15 UTC | |
by smokemachine (Hermit) on Mar 15, 2006 at 23:42 UTC | |
by bioMan (Beadle) on Mar 16, 2006 at 21:18 UTC |