Catman...::Path(3pm)
β¨ Catmandu::Util::Path β¨
okay so bestie, gather round, because this is the Catmandu::Util::Path page β straight out of the User Contributed Perl Documentation, section 3pm, and it's giving path-related utility functions and nothing else. short page, elite content, we love a concise icon π
π¦ NAME π¦
Catmandu::Util::Path β path related utility functions. that's it, that's the whole name, no notes π
πΈ FUNCTIONS πΈ
looks_like_path($str)
this one is your lil vibe check for strings π«Ά it returns 1 if the string you handed it is a path, and 0 if it's not.
β οΈ but fr fr, at the moment it only recognizes Catmandu::Path::simple paths β and specifically ones prefixed with a dollar sign. that's the whole guest list. no plus-ones. periodt.
like, watch:
looks_like_path("$.foo.bar.$append")
# => 1
looks_like_path("waffles")
# => 0
"$.foo.bar.$append"? iconic, valid, a path. "waffles"? bestie that's breakfast, not a path π returns 0, respectfully.
as_path($str, $type)
this is the helper function that hands you back a Catmandu::Path instance for whatever path string you gave it. glow-up complete β¨
the optional $type argument gives preliminary support for alternative path implementations β and it defaults to 'simple'. so if you don't say anything, simple is what you get, and honestly? she's serving.
check the receipts:
as_path("$.foo.bar.$append")
# is equivalent to
Catmandu::Path::simple->new(path => "$.foo.bar.$append");
so yeah, as_path("$.foo.bar.$append") is literally the same thing as calling Catmandu::Path::simple->new(path => "$.foo.bar.$append") yourself. same energy, less typing, we stan a shortcut π
π quick recap so it's locked in:looks_like_path($str)= is it a path or not,as_path($str, $type)= gimme the actual path object. two functions, zero drama. ate. no cap. π¦
and that's the whole page bestie, we made it π«Ά this was perl v5.40.1, dated 2026-01-24 β mwah, take care of her, she's tiny but she's perfect ππΈβ¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms