in reply to Random Couple Script

A direct way without explicit shuffle (only half the rand calls):
#!/usr/bin/perl -w use strict; use warnings; my @people = map /\.(.*)/, <DATA>; my $group = 1; while (@people) { my $person1 = shift @people; my $pos = rand @people; my $person2 = $people[$pos]; $people[$pos] = $people[-1]; pop @people; printf "Group %d: %s and %s\n", $group++, $person1, $person2; } __DATA__ 1.bobby 2.jane 3.charleen 4.markus 5.gabriel 6.Alex