It occurs to me that this could be accomplished by a partial Fisher-Yates shuffle. Hard to imagine the savings being important enough to warrant a new function in the
List::Util family, though. In Perl:
my @a = ('a'..'z');
my $take = 5;
for (0..$take-1) {
my $swap_with = $_ + rand(@a-$_);
@a[$_,$swap_with] = @a[$swap_with,$_];
}
print join(',', @a[0..$take-1]), "\n";
Caution: Contents may have been coded under pressure.