Help for this page

Select Code to Download


  1. or download this
    sub cross {
        my $f = shift or return;                  # Nothing.
    ...
        my @r = cross(@_);                        # Recurse.
        map {my $l = $_; map {[$l, @$_]} @r} @$f; # Distribute.
    }
    
  2. or download this
    sub cross {
        my $f = shift or return [];               # Nothing.    
        my @r = cross(@_);                        # Recurse.
        map {my $l = $_; map {[$l, @$_]} @r} @$f; # Distribute.
    }