Help for this page

Select Code to Download


  1. or download this
        my %seen;
        for ( my $i = 0; $i < scalar @arr; $i++){
            splice @arr, $i--, 1
                if $seen{$arr[ $i]}++;
        }
    
  2. or download this
        my %seen;
        for ( my $i = @arr; $i--; ){
            splice @arr, $i, 1
                if $seen{$arr[$i]}++;
        }
    
  3. or download this
        my %seen;
        @arr = grep !$seen{$_}++, @arr;