The following will return a random key from the top level hash (in this case foo
or bar) which is then used to grab a value from the second level hash:
my %hash = (
foo => { x => "0", y => "1" },
bar => { x => "2", y => "3" }
);
print $hash # reference to the top level