The subroutine rand_elt chooses and return a random element of the parameter list.
my $prefix = rand_elt keys %hash;
In reply to How it works? by monorels