Subject: | Multi iterations of the same input data on combine() returns un-expected results |
If calling combine() multiple times in the same program with the same
input data only the first set of results are as expected, the second
(etc) set of results do not match the first as expected.
Perl Version = v5.8.8 built for MSWin32-x86-multi-thread
Example code :-
#!/usr/bin/perl
use Math::Combinatorics;
@met=qw(TN AT NTRF KNNK);
@met=sort(@met);
for($b=0;$b<2;$b++){
print "\nMet = @met\n";
@metnew=(@metnew,map { join "_", @$_ } combine(2,@met));
foreach $a (@metnew) {
print "\n",$a;
}
@metnew=();
print "\nMetnew = @metnew\n";
}
Example Results :-
Met = AT KNNK NTRF TN
AT_KNNK
AT_NTRF
AT_TN
KNNK_NTRF
KNNK_TN
NTRF_TN
Metnew =
Met = AT KNNK NTRF TN
KNNK_TN
KNNK_AT
KNNK_NTRF
TN_AT
TN_NTRF
AT_NTRF
Metnew =