title: removing duplicate hash value and keeping a count of it in perl
body: <p>Lets say</p>
  
  <pre><code>%hash = (
          key1 =&gt; 'one',
          key2 =&gt; 'two',
          key3 =&gt; 'three',
          key4 =&gt; 'two',
          key5 =&gt; 'one',
  );
  </code></pre>
  
  <p>I want to have two arrays:</p>
  
  <ol>
  <li><p>This array should have unique key/value</p>
  
  <p>@array1=(key1 one key2 two key3 three)</p></li>
  <li><p>this array should have count of duplicates by value (eg here only three value are unique so 'one' is found twice and 'two' found twice again and 'three' found once).</p>
  
  <p>@array2=(2 2 1)</p></li>
  </ol>