my %set1 = map { $_ => 1 } @array1; my %set2 = map { $_ => 1 } @array2; my %intersection = grep $set1{$_}, keys %set2;
That assumes true values. You're using weird values, so you might have to use exists.
In reply to Re: Using hashes for set operations...
by ikegami
in thread Using hashes for set operations...
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |