If I understand your question correct, then you only need to discover repeated pairings, no need to save the concrete names (but see below) ?

You could normalise a pair (e.g. sort alphabetically → "Lois,Tarzan" or "Clark,Jane"), pipe that through an MD5 or SHA1 and save this obfuscated pair (e.g. a line of hex digits: affe8deadbeef0815.... etc.) into a text file. It should be obfuscated enough to scare the occasional snoop. Your script would test for a duplicate by generating the hash for the pair to test and look it up in the list of historical pairings hashes. When found, start a new draw.

Instead of running an eMail distribution-script once a year, run the Secret Santa script once a year and let it send the eMails in the same turn. After the script terminates, the concrete names are lost, but the file is updated with a couple of new pairings (hashes) to avoid duplicated pairings for next year's run. If your number of pairs is large, a faster and more compact way to save the pairings is required.


In reply to Re: Temporarily Obscuring a Lottery Draw by Perlbotics
in thread Temporarily Obscuring a Lottery Draw by kennethk

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.