Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Generating all possible combinations from an AoA

by james2vegas (Chaplain)
on Apr 13, 2011 at 09:06 UTC ( #899129=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://899129]
help
Chatterbox?
[Your Mother]: I don't care what any of you say. Tamales are great.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2016-12-06 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (109 votes). Check out past polls.