my @U = @NU; #### my @U = uniq @NU; # From List::Util #### my %seen; my @U = grep !$seen{$_}++, @NU;