OK, let me state first of all that I'm not asking for code (although all donations gratefully recieved), just general advice as to how to go about a particular task.
I have in my possession 36 text files that look like this (only longer):
-0.29 -0.39 -0.51 -0.65 -0.85 -1.07 -1.33 -1.66 -1.92 -2.11 -2.21
And I want to be able to write a perl script that will randomly select 3 of this files and print the contents of the remainder (i.e. the other 33 files) into one file like this
-0.29 -0.2 0.62 -0.82 -0.39 -0.25 0.79 -1.05 -0.51 -0.34 0.97 -1.35 -0.65 -0.46 1.15 -1.67 -0.85 -0.64 1.34 -2.07 -1.07 -0.86 1.57 -2.55 -1.33 -1.07 1.8 -3.05 -1.66 -1.33 2.05 -3.64 -1.92 -1.57 2.21 -4.28 -2.11 -1.77 2.23 -4.91 etc ... for 33 files
I want to be able to do this a number of times until all combinations have been covered ensuring that a particular 'three file combination' is only chosen once (of course any file can, on its own, be chosen a number of times, but only once in a particular combination of two other files ... make sense?).
So far, my logic on how to proceed is as follows:
Rename the text files 1 to 36 and then chose a particular three way combo using a random number generator. A flag would then have to be created .. perhaps a variable that is unique only to that particular 3 file combo ... which is set to 1, to ensure that this combo is not picked again.
The end result file is then created from the remaining 33 files.
Logical or not? Any advice, pointers much appreciated.

In reply to randomly selecting files by Angharad

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.