Make a bit vector, each bit corresponding to a search term (bit 0 means 'male', bit 1 'female'). Convert your occurences into bit vectors as well and use those as keys in your tally ([ 'male', 'child'] would have bits 0 and 2 set (0b101)). Then turn the bit vector keys back into the original terms on the way out.
Update: I was going to expand on this but connectivity on the train was kinda spotty. At any rate, see perldoc -f vec and search for Set modules on CPAN (since that's basically what you're asking about).
In reply to Re: matching arrays
by Fletch
in thread matching arrays
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |