Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
I have two arrays @a and @b, i want to remove the similar elements in both arrays and retain the dissimilar elements.
@a = (2, 6.5 ,4, 3, 2, 7.5, 4.0); @b = (2, 6.52 ,4.5, 7.05, 2.0, 4.1, 3);
The output i need is:
@a = (6.5, 4, 7.5, 4.0) @b = (6.52, 4.5, 7.05, 2.0, 4.1)
How can we attain this.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Remove similar elements in both the array
by data64 (Chaplain) on Mar 08, 2005 at 05:07 UTC | |
by DrHyde (Prior) on Mar 08, 2005 at 10:32 UTC | |
Re: Remove similar elements in both the array
by tilly (Archbishop) on Mar 08, 2005 at 04:38 UTC | |
by davis (Vicar) on Mar 08, 2005 at 09:58 UTC |