my %hash = ('foo' => 'bar', 'bar' => 'foo'); my ($key, $val) = each(%hash); print "$key\n";