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

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

associate two values as a hash key and value

## NAME

Catmandu::Fix::assoc - associate two values as a hash key and value

## SYNOPSIS

```
   # {pairs => [{key => 'year', val => 2009}, {key => 'subject', val => 'Perl'}]}
   assoc(fields, pairs.*.key, pairs.*.val)
   # {fields => {subject => 'Perl', year => 2009}, pairs => [...]}
```

## SEE ALSO

Catmandu::Fix
