You are missing a $_ there. And it doesn't work. (Consider @list1=(); @list2=qw(foo foo);.)my %seen; $seen{$_}=1 for @list1; my @intersection = grep ++$seen{}==2, @list2;
In reply to Re^2: is there a more simple way to have the intersection of two lists ?
by ysth
in thread is there a more simple way to have the intersection of two lists ?
by steph_bow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |