1234567891011
my %hash = ( "name" => "lucas");my $res = get_key("lucas");sub get_key { foreach (my ($key, $value) = each(%hash)) { return "$key\n" and last if $value eq $_[0]; }}