in reply to Re^2: Search and Remove
in thread Search and Remove

You cannot use length to get the number of array elements, see length and scalar (the latter you should use instead).

The last line is also strange. Do you really want to unlink the arrays?