in reply to using hash uniqueness to find the odd man
@a = (1,2,4); @b = (1,2,3,4); my %seen; for (@a) { $seen{$_}++; } for (@b) { print "$_ was in \@b but not in \@a\n" unless $seen{$_}; }
Oh, I believe that this is called finding the difference of the arrays.
-Blake
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: using hash uniqueness to find the odd man
by novitiate (Scribe) on Jul 11, 2001 at 04:42 UTC | |
by tadman (Prior) on Jul 11, 2001 at 06:04 UTC |