Help for this page

Select Code to Download


  1. or download this
      use List::Util 'reduce';
    
      my $closest = reduce { abs($a - $ctime) < abs($b - $ctime) ? $a : $b
    + } @epochs;
      print $closest;
    
  2. or download this
      my $closest = reduce { $a->[1] < $b->[1] ? $a : $b }
                    map [ $_ => abs($ctime - $_) ], @epochs;
      print $closest->[0];