---
name: "Catmandu::Fix::set_array"
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_array"
---

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

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

## NAME

Catmandu::Fix::set\_array - add or change the value of a HASH key or ARRAY index to an array

## 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 array
   set_array(foo)
   # Or an array with initial contents
   set_array(foo, "a", "b", "c")
```

## SEE ALSO

Catmandu::Fix
