in reply to Ludicrously Stupid Foreach Loop Question
perldoc -q intersection might be of marginal interest.