in reply to Re^3: Cartesian Cross-Products
in thread Cartesian Cross-Products

That
my @C = map { [ $_ ] } @{ shift @_ };
Can be simplified to:
my @C = [];
Don't believe me? Try it. Also, it now works correctly in the case you pass no arguments to the function. This may be a matter of taste, but I prefer the leftmost array to be the outermost loop. So that leaves us with:
sub cartesian { my @C = []; foreach (reverse @_) { my @A = @$_; @C = map { my $n = $_; map { [ $n, @$_ ] } @C } @A; } return @C; }