<p>Let's make this very easy. What I want:</p>

<pre><code>@array = qw/one two one/;
my @duplicates = duplicate(@array);
print "@duplicates"; # This should now print 'one'.
</code></pre>

<p>How to print duplicate values of a array/hash?</p>

Use a dictionary, put the value in the key, and the count in the value.
Ah, just noticed you've tagged as perl
```
while ([...]) {
 $hash{[dbvalue]}++
}
```