Help for this page

Select Code to Download


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