Catman...::YAML(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Catmandu::Importer::YAML(3pm) πŸ’–

okay so bestie, you opened the 3pm manual page and it's literally the Catmandu::Importer::YAML one β€” the package that imports YAML data. yes. that's the whole vibe. let's go πŸ¦‹


✨ NAME ✨

Catmandu::Importer::YAML β€” the package that imports YAML data. that's it, that's the girl πŸ’…


🌸 SYNOPSIS 🌸

From the command line, queen:

# From the command line

$ catmandu convert YAML to JSON < data.yaml

Or living your best life inside a Perl script:

# In a Perl script

use Catmandu;

my $importer = Catmandu->importer('YAML',file => "/foo/bar.yaml");

my $n = $importer->each(sub {
    my $hashref = $_[0];
    # ...
});
🚨 IMPORTANT SIS 🚨 the YAML input file has to be separated into records. it's giving "please divide your data", no cap:
---
- recordno: 1
- name: Alpha
---
- recordno: 2
- name: Beta
...

where '---' is the record separator and '...' the EOF indicator. iconic. memorise it fr fr πŸŽ€


πŸŽ€ CONFIGURATION πŸŽ€

🌈 file

Read input from a local file given by its path. Alternatively a scalar reference can be passed to read from a string. cute, flexible, obsessed ✨

🌈 fh

Read input from an IO::Handle. If not specified, Catmandu::Util::io is used to create the input stream from the "file" argument or by using STDIN. so like, if you don't hand it one, it makes its own 🫢

🌈 encoding

Binmode of the input stream "fh". Set to ":utf8" by default. default slay πŸ’œ

🌈 fix

An ARRAY of one or more fixes or file scripts to be applied to imported items. glow-up your records on the way in 😭✨


πŸ‘‘ METHODS πŸ‘‘

Every Catmandu::Importer is a Catmandu::Iterable and all its methods are inherited. and now the tea: the Catmandu::Importer::YAML methods are not idempotent β€” YAML feeds can only be read once. so do not come back for seconds, bestie, the stream is gone πŸ’€ one read, one shot, periodt.


πŸ”₯ SEE ALSO πŸ”₯

  • Catmandu::Exporter::YAML β€” the other half of the duo, go say hi πŸ’–

and that's the page, bestie!! πŸŽ€ this one came to you from perl v5.40.1, dated 2026-01-24, and the header was out here calling itself Catman...::YAML(3pm) like a shy queen. mwah, go import something gorgeous πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from