Skip Menu |

This queue is for tickets about the Algorithm-Permute CPAN distribution.

Report information
The Basics
Id: 45434
Status: resolved
Priority: 0/
Queue: Algorithm-Permute

People
Owner: Nobody in particular
Requestors: PWES [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.12
Fixed in: 0.13



Subject: Incorrect reset for 'k from n' permutations
When generating permutations for r elements of n, reset() method "breaks" the object: ===== use Algorithm::Permute; my $p = Algorithm::Permute->new([1..4], 2); $p->reset; while (my @a = $p->next) { print join(',', @a), "\n" } $p->reset; print "##########\n"; while (my @a = $p->next) { print join(',', @a), "\n"; } ===== 2,1 1,2 3,2 2,3 3,1 1,3 4,2 2,4 4,3 3,4 4,1 1,4 ########## 4,1 1,4 ===== Looks like if reset() trims [1..4] to [1,4].
fixed since 0.13