Dear perl monks, I am sorry to post this second question so rapid after the first, i am dying to know the answer to this one as well: i am trying to perceive Games::Cards::Poker, understand it to some extent . I want to have an array that has all possibilities of 56*55*54*53*52, I want to have every single combination of 5 cards out of 56

my @total = ("1-S","2-S","3-S","4-S","5-S","6-S","7-S","8-S","9-S","10-S","11-S","12-S","13-S","14-S","1-H","2-H","3-H","4-H","5-H","6-H","7-H","8-H","9-H","10-H","11-H","12-H","13-H","14-H","1-R","2-R","3-R","4-R","5-R","6-R","7-R","8-R","9-R","10-R","11-R","12-R","13-R","14-R","1-K","2-K","3-K","4-K","5-K","6-K","7-K","8-K","9-K","10-K","11-K","12-K","13-K","14-K");

I got the perl module Set::CrossProduct but i don't know how to utilize it in such a way that I get 56*55*54*53*52 combinations of 5 cards in one array, the problem i think is that i can make it choose an item out of five lists but then it would choose the same item twice since i cant delete one out of the second list it has to go through since it chooses a different item every time. Could someone maybe tell me how to do this particular thing with this module or recommend another one? Thank you so much in advance


In reply to How to get all combinations by robertw

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.