in reply to Sets of subsets
You might find Set::Partition or the partitions method of Algorithm::Combinatorics helpful.