in reply to Re^2: Permuting with duplicates and no memory
in thread Permuting with duplicates and no memory
Just FYI, perhaps you missed this bit from the root node:
do { print "@ARGV\n"; } while( nextPermute(@ARGV) );
which is also why I called my routine "nextPermute".
Also note that dragonchild's and my iterators can be reused. For yours to be reusable you probably want to change:
return if $i == -1;
to
if( $i == -1 ) { $first= 1; return; }
- tye
|
---|
In Section
Cool Uses for Perl