in reply to Comparing two arrays (was: any smart ideas??:)
Not to try and throw you in over your head, but if the context of your program is more related to set operations than to array properties, you may want to have a look at Set::Scalar. This module will allow you do something as simple as:
And the output:use Set::Scalar ; my $s = Set::Scalar->new( 'a', 'b', 'c', 'd' ) ; my $t = Set::Scalar->new( 'a', 'e', 'c', 'o' ) ; my $u = $s->intersection( $t ) ; print $u, "\n" ;
(a c)
|
|---|