my %hash = ( k0 => 'c0', k1 => 'v1', k2 => 'v2', k3 => 'v3', ); my $search = 'k2'; my $val = $hash{$search};