in reply to Combinations of array?
This was recently asked at All possible number combinations in perl.