develooper Front page | perl.fwp | Postings from November 2001

Gift Giving... in Perl?

Thread Next
From:
Jeremy Zawodny
Date:
November 27, 2001 15:01
Subject:
Gift Giving... in Perl?
Message ID:
20011127145616.A22780@thinkpad0.zawodny.com
Since it's the holiday season, someone recently asked me if I could
hack out a quick script to setup a "scecret santa" system.  The basic
idea was this:

    Feed a script a bunch of e-mail addresses.  The script will assign
    each person (address) the address of someone they should give a
    gift to.  Each person only gives one gift and receives one gift.
    Of course, nobody will give a gift to themselves.  (It should also
    e-mail everyone automatically so that the person running the
    script doesn't even know the outcome--but I didn't worry about
    that part at all.)

What I managed to hack out was rather ugly.  I'm unhappy with it.
It just didn't feel like the *right* solution, since it had some odd
logic in it.  That fact that I was watching TV at the time probably
didn't help.

Anyone done this before and come up with something they think is
particularly elegant or clever?

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<Jeremy@Zawodny.com>  |  http://jeremy.zawodny.com/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About