You might find Set::Partition or the partitions method of Algorithm::Combinatorics helpful.
In reply to Re: Sets of subsets by ig in thread Sets of subsets by jpearl