Beef up any_equals and add a perl5 emulation using grep