Help for this page

Select Code to Download


  1. or download this
    my %hash;
    @hash{@arr2}=(1) x @arr2;
    my @cleaned=grep !$hash{$_},@arr1;
    
  2. or download this
    E:\Bin>perldoc -q "difference of two arrays"
    Found in E:\Perl\lib\pod\perlfaq4.pod
    ...
                Note that this is the *symmetric difference*, that is, all
                elements in either A or in B but not in both. Think of it 
    +as an
                xor operation.