#!/usr/bin/perl sub dm { $absmin = 10000; while (<>) { ($sol, $min, $max) = /\s+(\d+)\s+(\d+)\s+(\d+)/; #print $sol . " " . $min . " " . $max . "\n"; if ($min < $absmin && $min > 0) { $absmin = $min; $abssol = $sol; #print "tmp: " . $abssol . "\n"; } } return $abssol; } print &dm();