$hash{"$regexp"} = $value; $regexps{"$regexp"} = $regexp; ... $value = $hash{$key}; $regexp = $regexps{$key};