Help for this page

Select Code to Download


  1. or download this
      my %item_count;
      %item_count{$_}++ foreach (@array);
    
  2. or download this
      @result = grep {$item_count{$_} == 1} @array;
    
  3. or download this
      my %item_count;
      %item_count{$_}++ for grep {/pattern/} @array
      @result = grep {$item_count{$_} <= 1} @array;
    
  4. or download this
      @result = grep {($item_count{$_}||0) <= 1} @array;