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

# Catmandu::Util::Path(3pm)

Path related utility functions

## NAME

Catmandu::Util::Path - Path related utility functions

## FUNCTIONS

- looks\_like\_path($str)

  Returns 1 if the given string is a path, 0 otherwise.  Only recognizes Catmandu::Path::simple paths prefixed with a dollar sign at the moment.

  ```
      looks_like_path("$.foo.bar.$append")
      # => 1
      looks_like_path("waffles")
      # => 0
  ```

- as\_path($str, $type)

  Helper function that returns a Catmandu::Path instance for the given path string.  The optional `$type` argument gives preliminary support for alternative path implementations and defaults to 'simple'.

  ```
      as_path("$.foo.bar.$append")
      # is equivalent to
      Catmandu::Path::simple->new(path => "$.foo.bar.$append");
  ```
