title: how to remove duplicate words from a line of a file using perl
body: <p>I am new to perl and looking for a perl solution for a relatively simple problem. I want to remove duplicate words from a line of a file using perl. All the examples on web deal with duplicate lines, but I am looking for removing duplicate words. Any help is greatly appreciated.</p>
  
  <p>Here is my file</p>
  
  <pre><code>lot=list("XI_PBIAS.mMN_VDD_CAP1_BM" "XIBIAS2.mNCS_BIAS_BM" "XIBIAS2.mNCS_BIAS_BM"          "XIBIAS1.mNCS_PCAS_BIAS_BM" "XIBIAS1.mNCS_PCAS_BIAS_BM" "XI_PBIAS.mNCS_PCS_BIAS_BM" )
  filename  = "tx_dac_bias_tb"
  openResults(strcat(filename ".raw"))
  </code></pre>
  
  <p>I want the strings <code>"XIBIAS2.mNCS_BIAS_BM"</code> and <code>"XIBIAS1.mNCS_PCAS_BIAS_BM"</code> to appear only once. How do I reads the file word by word instead of line by line.</p>