in reply to Re: Random Couple Script
in thread Random Couple Script

Using splice to deconstruct the list, instead of to construct it:
# Read names, chop off numbers my @names = map /\.(.*)/, <DATA>; # Pair them up randomly for (1..@names/2) { printf "Group $_: %s and %s are partners\n", splice(@names, rand(@na +mes), 1) , splice(@names, rand(@names), 1); }
Update: using Thospel's idea, one of the splices could be replaced with a simple shift:
printf "Group $_: %s and %s are partners\n", shift(@names), splice(@ +names, rand(@names), 1);

Caution: Contents may have been coded under pressure.