I agree my explanation of what I regard equal could be a little better. Your function doesn't work for me because I have to distinguish between an undef and a numeric 0 for instance (your function says these are equal).
I'll work out a testmatrix and manually check what i regard equal or not, thanks for that suggestion.