Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: generate combinations of lists

by ikegami (Patriarch)
on Sep 28, 2005 at 06:07 UTC ( [id://495636]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Algorithm::Loops qw( NextPermute );
    
    ...
    do {
       print(join(', ', @list), "\n");
    } while (NextPermute(@list));
    
  2. or download this
    There are 24 permutations of abcd, 4 taken at a time:
       abcd, abdc, acbd, acdb, adbc, adcb,
    ...
    There are  3 combinations of abcd, 3 taken at a time:
       abc, abd, acd, bcd
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://495636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2024-04-23 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found