# ($k,$v) = rhe_1(%hash); sub rhe_1 (\%) { my $key = (keys %{ $_[0] })[rand keys %{ $_[0] }]; return ($key, delete $_[0]{$key}); }