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