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

# Catmandu::Fix::move\_field(3pm)

move a field to another place in the data structure

## NAME

Catmandu::Fix::move\_field - move a field to another place in the data structure

## SYNOPSIS

```
   # Move single fields
   # Move 'foo.bar' to 'bar.foo'
   move_field(foo.bar, bar.foo)
   # Move multipe fields
   # Data:
   # a:
   #   b: test1
   #   c: test2
   move_field(a,z)  # -> Move all the 'a' to 'z'
                    # z:
                    #   b: test1
                    #   c: test2
   # Data:
   # a:
   #   b: test1
   #   c: test2
   move_field(a,.)  # -> Move the fields 'b' and 'c' to the root
                    # b: test1
                    # c: test2
```

## SEE ALSO

Catmandu::Fix
