Just another Perl shrine | |
PerlMonks |
Re: Re: Re: @array1 vs @array2by mikfire (Deacon) |
on Mar 19, 2001 at 22:47 UTC ( [id://65502]=note: print w/replies, xml ) | Need Help?? |
Remove the comma from the regex.
But really, do not do it this way. Given that you are processing the entire contents of @array2 for each element in @array1, you have suddenly created an O(n^2) algorithm. This will hurt very quickly if either @array1 or @array2 gets very large. Especially since I would expect @array2 >> @array1. Try the one of the two hash solutions presented ( either one does basically the same thing ).
In Section
Seekers of Perl Wisdom
|
|