You can use grep.
Now @a and @b should be equal, containing only the common elements.my (%a, %b); @a{@a} = (); @b{@b} = (); @a = grep {exists $b{$_}} @a; @b = grep {exists $a{$_}} @b;
Added - fixed missing curlies, tlm++.
After Compline,
Zaxo
In reply to Re: Further question on removing elements from arrays
by Zaxo
in thread Further question on removing elements from arrays
by sandrider
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |