Help for this page

Select Code to Download


  1. or download this
    foreach $e (@a, @b) { $union{$e}++ && $isect{$e}++ }
    
    @union = keys %union;
    @isect = keys %isect;
    
  2. or download this
    @diff = ();
    foreach $e (keys %union) {
       push(@diff, $e) unless $isect{$e};
    }
    
  3. or download this
    $s = new Set::Scalar (keys %hash1);
    $t = new Set::Scalar (keys %hash2);
    
    @isect = $s->intersection($t)->members;