Skip Menu |

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

Report information
The Basics
Id: 127086
Status: new
Priority: 0/
Queue: Algorithm-Permute

People
Owner: Nobody in particular
Requestors: rkleemann [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Original array is emptied when doing full permutations
Date: Mon, 10 Sep 2018 11:49:52 -0700
To: bug-Algorithm-Permute [...] rt.cpan.org
From: Bob Kleemann <rkleemann [...] gmail.com>
When iterating over all possible permutations, there is a strange result after the last permutation is complete: perl -MAlgorithm::Permute -E ' my @elements = ( 1, 2, 3 ); for ( my $size = 1 ; $size <= scalar(@elements); $size++ ) { say "size = $size"; my $p = Algorithm::Permute->new(\@elements, $size); while ( my @list = $p->next ) { say "[ ", join( ", ", @list ), " ]"; } say scalar @elements, " = [ ", join( ", ", @elements ), " ]"; } ' I would expect that @elements would be returned to the original content on the completion of the for loop.