in reply to Conditional Elimination

First, you should not be using variables $a and $b because these are magic variables used in sort. More importantly they are probably meaningless in your context.

Anyway, you might be better off using a regular expression (RE) to check patterns rather than literal values. I say 'might' because it really depends on the application, and REs can be slow. This is a balance decision which only someone with complete knowledge of the application can make.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.