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

# Catmandu::Fix::hash(3pm)

creates a hash out of an array

## NAME

Catmandu::Fix::hash - creates a hash out of an array

## SYNOPSIS

```
   # tags => ['name', 'Peter', 'age', 12]
   hash(tags)
   # tags => {name => 'Peter', age => 12}
```

## DESCRIPTION

This fix functions transforms array fields to hashes. The number of array elements must be even and fields to be used as field values must be simple strings. String fields and hash fields are left unchanged.

## SEE ALSO

Catmandu::Fix::array, Catmandu::Fix
