Catman...::YAML(3pm)
π 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
- 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