If a ref return value is wanted, just change "return @els" to "return \@els" in the sub that make_permutator returns.my @elements = qw(a b c); my $tupler = make_permutator(([@elements]) x 2 ); while (my @tuple = $tupler->() ){ print @tuple,"\n"; }
In reply to Re: Creating tuples based on sets
by shotgunefx
in thread Creating tuples based on sets
by waxmop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |