title: How do I print unique elements in Perl array?
body: <p>I'm pushing elements into an array during a while statement. Each element is a teacher's name. There ends up being duplicate teacher names in the array when the loop finishes.  Sometimes they are not right next to each other in the array, sometimes they are.</p>
  
  <p>How can I print only the unique values in that array after its finished getting values pushed into it?  Without having to parse the entire array each time I want to print an element.</p>
  
  <p>Heres the code after everything has been pushed into the array:</p>
  
  <pre><code>$faculty_len = @faculty;
  $i=0;
  while ($i != $faculty_len)
  {
          printf $fh '"'.$faculty[$i].'"';
          $i++;
  }   
  </code></pre>