---
name: "Catmandu::Fix::set_hash"
section: "3pm"
platform: "linux"
package: "libcatmandu-perl"
version: "1.2024-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Fix::set_hash"
---

# Catmandu::Fix::set\_hash(3pm)

add or change the value of a HASH key or ARRAY index to a hash

## NAME

Catmandu::Fix::set\_hash - add or change the value of a HASH key or ARRAY index to a hash

## DESCRIPTION

Contrary to `"add_field"`, this will not create the intermediate structures if they are missing.

## SYNOPSIS

```
   # Change the value of 'foo' to an empty hash
   set_hash(foo)
   # Or a hash with initial contents
   set_hash(a: b, c: d)
```

## SEE ALSO

Catmandu::Fix
