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 reply to Re: Re: Re: @array1 vs @array2
by mikfire
in thread @array1 vs @array2
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |