in reply to See if arrays match
Greetings anonymous,
The following was copied from the Perl Cookbook, Recipe 4.8 by Tom Christiansen & Nathan Torkington; ISBN 1-56592-243-3.
@a = (1, 3, 5, 6, 7, 8); @b = (2, 3, 5, 7, 9); foreach $e (@a, @b) { $union{$e}++ && $isect{$e}++ } @union = keys %union; @isect = keys %isect;
-gryphon
code('Perl') || die;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: See if arrays match
by ehdonhon (Curate) on Jul 23, 2002 at 21:39 UTC |