- or download this
sub iter {
my $vals = \@_;
...
# 0: ('a')
# 1: ('b')
# 2: ('c')
- or download this
sub iter_to_seq {
my ($iter) = @_;
...
# 0: (['a'])
# 1: (['b'])
# 2: (['c'])
- or download this
use List::Util qw( reduce );
...
sub iter_prod {
seq_to_iter( seq_prod( map iter_to_seq($_), @_ ) );
}
- or download this
my $abcees = iter(qw(a b c));
my $xyzees = iter(qw(x y z));
...
# 6: (['c','x'])
# 7: (['c','y'])
# 8: (['c','z'])
- or download this
my $product = iter_prod( $abcees, $xyzees );
...
# Got vars: c x
# Got vars: c y
# Got vars: c z