in reply to Efficient Comparison of Array elements
You want the intersection and the difference of two sets.
This is in the FAQ.
How do I compute the difference of two arrays? How do I compute the intersection of two arrays?.
By the way, your syntax for creating your arrays:
my @one = [1,2,3,4]; my @two = [2,4,6,8];
is wrong. It should be either:
my @one = (1,2,3,4); my @two = (2,4,6,8);
or
--my $one = [1,2,3,4]; my $two = [2,4,6,8];
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Efficient Comparison of Array elements
by aging acolyte (Pilgrim) on Jan 08, 2003 at 16:29 UTC |