in reply to Comparing Two Arrays
Using Set::Scalar, I would solve your problem as so:
use strict; use Set::Scalar; my $set1 = Set::Scalar->new( @array1 ); my $set2 = Set::Scalar->new( @array2 ); my $set3 = $set1->difference( $set2 )->union( $set2->difference( $set1 + ) ); my @array3 = $set3->members;
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Thanks (Re^2: Comparing Two Arrays)
by Anonymous Monk on Feb 23, 2005 at 23:00 UTC |