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1G1A1C1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G2A1C1~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C2G1A1C1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~C1G1A1C1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G1~ ~C1G2A1C1~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C1G2~ ~C2G1A1C1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~C2G1~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~A1C1~ ~~ ~~ ~~ ~~ ~~ ~~ ~~

Here the input files i.e. k1.txt, k2.txt, k3.txt are small. When the input files are large, then I shall face problem in selecting the desired longest combinations from a very large cmd or text file output. It will be much easier if the output text file shows only the longest combinations as given above. I think it is not very easy task in perl. I think so because poj has also suggested a script which produces many unwanted combinations along with the desired 6-letter longest combinations. From the output text file, the unwanted combinations are to be deleted manually to retain only the longest correct, desired combinations. It will be a very time-taking task for more input files with large size. I wish perl could solve this problem.


In reply to Re^6: How can one get all possible combinations of elements of different arrays using File::Glob(bsd_glob)? by supriyoch_2008
in thread How can one get all possible combinations of elements of different arrays using File::Glob(bsd_glob)? by supriyoch_2008

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.