If I have a hash
my %h = ( secret => 1; );
and I know that is only is one key in the hash, but I don\'t know what it is called.
I do not believe it is necessary to use the keys function.
keys
my ($key) = %h;
or
my $key = (%h)[0];
The hash inside the parens will be expanded to a list, then we can simply take the first element of that list, which is the key.