in reply to Clarification of code - find array intersection

Cleaning up the code for the monks:
@union = @intersection = @difference = (); %count = (); foreach $element (@array1, @array2) { $count{$element}++ } foreach $element (keys %count) { push @union, $element; push @{ $count{$element} > 1 ? \@intersection : \@difference }, $e +lement; }
relientmark, It would help if you read How do I post a question effectively?

Replies are listed 'Best First'.
Re^2: Clarification of code - find array intersection
by relientmark (Novice) on Mar 16, 2011 at 03:18 UTC
    Just read, and will follow in future. Thanks mate.

      The future is now if you simply edit your original post and add the tags.