# get best match by getting relative distances and # taking the lowest value my %dist; @dist{@input} = map { abs } adistr($target, @input); my ($best) = sort { $dist{$a} <=> $dist{$b} } @input; # re-check match to make sure it's good enough if ($best and amatch($target, $best)) { # got a match... } else { # no such luck. } #### $target = 'source'; @inputs = qw(donor_dedupe_source indicted_video_source source1);