in reply to Comparing Two Arrays
Update: dragonchild is right. map is slower than a for loop. Use his code above, but you should still learn the wonderful world of map!my @array1 = (1, 2, 3); my @array2 = (3, 4, 5); my %union = (); map { $union{$_}++ } (@array1, @array2); my @array3 = keys %union;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Arrays
by dragonchild (Archbishop) on Dec 08, 2001 at 00:47 UTC | |
by joealba (Hermit) on Dec 08, 2001 at 00:52 UTC | |
by runrig (Abbot) on Dec 08, 2001 at 15:05 UTC | |
|
Re: Re: Arrays
by rje (Deacon) on Dec 08, 2001 at 00:47 UTC |