in reply to Sports Team allocation

Have you considered Algorithm::Permute? It might be helpful, but I have not used it much myself. Just a thought.