When I study a syntax, I try to use it for any odd task that turns up. We have a contest for a club of sorts where the winner gets a prize of value $25 or so, but the idea is to foster participation. Hence, we don't want perpetual winners or the winner to be the person who sits at his computer all day, so we're choosing a random correct answer as opposed to the first.

Where I'm stuck now is making a composite of the those who answer correctly less those who have already won. I looked for examples in the books I have and couldn't find one. If I were to proceed in the manner of the syntaxes I've studied before, I would loop through indices, making exhaustive comparisons. What is the perl way to remove a sublist from another list

$ perl rand1.pl 7246281254938614119473194136957146644855362901505395617562308444592359 +441659779924940736387588266118823158415004985978328481067994672839164 +223678436588869 2 $ cat rand1.pl #!/usr/bin/perl -w use strict; use feature ':5.10'; use Crypt::Random qw( makerandom ); my $r = makerandom ( Size => 512, Strength => 1 ); print "$r\n"; srand($r); my @winners=("ruth","sheila"); my @correct=("ruth","martin","dee","zack"); my @composite = @correct - @winners; print "@composite \n"; $

Thanks in advance,


In reply to removing a sublist by Aldebaran

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.