Although it addresses partitioning rather than the specific problem of the OP, section 5.1.1 "Finding All Possible Partitions" of Dominus's freely downloadable (and highly recommended) Higher Order Perl discusses an iterative approach that could be adapted to the OPed problem.
In reply to Re: All possible number combinations in perl
by AnomalousMonk
in thread All possible number combinations in perl
by austinj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |