http://www.perlmonks.org?node_id=899129


in reply to Generating all possible combinations from an AoA

Use File::Glob's bsd_glob function, something like:

use File::Glob (bsd_glob); my @array = ( [ "a", "b", "c", ], [ "1", "2", "3", "4", ], [ "x", "y", ], ); my $glob = join( '', map { '{' . join( ',', @$_ ) . '}' } @array ); my @list = bsd_glob($glob);


Update: I guess I approached this as a Perl programming problem not as a programming logic problem, oh well.