Hi, Im stuck with a little problem. I got two arrays @notwanted = "james,bob,inga" @users = "dick,lisa,bob,elvis" I would like to match @users agains @notwanted and save alla users from the that *didn't* match anyone in the @notwanted array and save the result in a new array. Anyone got a fresh idea? =)
Nothing fresh. My first thought would be to use a nested loop. Loop through the larger array, and in each iteration loop throuh the smaller looking for a match. Depending on the type of array and if it isn't more overhead than it's worth, remove the matched items from your arrays as you go through so you speed up as you go. If the arrays are relatively small I wouldn't worry about removing.
What probably would work faster is to put one array in a hash and the loop the other arry for a match