http://qs1969.pair.com?node_id=11151052


in reply to Perl Weekly Challenge 206 with List::Util

Just for fun and with many doubts on my own working solution, a nice oneliner for the first challange on time differences

perl -le "@v=sort{push@r,abs$a-$b;$a-$b}map{($h,$m)=split':',$_;$M=60* +$h+$m;($M,$M+1440,$M+2880)}@ARGV;print+(sort{$a<=>$b}@r)[0]" @ARGV = 00:00 23:55 20:00 => 5 @ARGV = 01:01 00:50 00:57 => 4 @ARGV = 10:10 09:30 09:00 09:55 => 15

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.