my %unround; @unround{@short_nums} = @nums; my @new_array = map {$unround{$_}} grep {exists $unround{$_}} @found;