Consider the filled hash:
%hash = ( ... );
I want to get the value from the hash; any value will do.
I would like to avoid
$arbitrary_value = (values %hash)[0];
since I really don't want to create an array of keys, just to get the first one.
Is there a way to do this without creating a list of values?
NB: It doesn't have to be random. Any value will do.
Any suggestions?
EDIT: Suppose I don't know any of the keys.
source share