Hrrmm, I must admit I like this solution better than my solution. It's cleaner and simpler. Darn that "Keep it simple".
But it still suffers from having to look up the match afterwards, and that I don't like. Indeed it's a good way, but for a large
and some "bad luck" you still have notably unnecessary overhead when having large lists to check against. For simple things that other people might read I'd use your method, but for a module that needs efficiency (don't all?) I'd use my way, I think.