- or download this
@data_out = uniq(@sorted_data);
...
return (uniq(@xs)) if grep {substr($x,0,7) eq substr($_,0,7)} @xs;
return ($x,uniq(@xs));
}
- or download this
foreach (reverse @sorted_data) {
unshift(@data_out, $_) unless ($seen{substr($_,0,7)}++);
}
- or download this
@data_out = nub(@sorted_data);
...
return $x unless @xs;
return (nub(grep {substr($x,0,7) ne substr($_,0,7)} @xs), $x);
}