Catman...::YAML(3pm)
π Catmandu::Exporter::YAML π
okay bestie, so this page is from the Catman...::YAML(3pm) section of the manual β and no cap, it's the whole tea on Catmandu::Exporter::YAML, aka a YAML exporter. she exports YAML. that's the vibe. π
β¨ NAME β¨
Catmandu::Exporter::YAML β a YAML exporter π¦
β¨ SYNOPSIS β¨
lowkey the fastest way to get it? straight from the commandline, bestie:
# From the commandline
$ catmandu convert JSON --fix myfixes to YAML < /tmp/data.json
or if you're a Perl girlie (and you ARE, iykyk):
# From Perl
use Catmandu;
# Print to STDOUT
my $exporter = Catmandu->exporter('YAML', fix => 'myfix.txt');
# Print to file or IO::Handle
my $exporter = Catmandu->exporter('YAML', file => '/tmp/out.yml');
my $exporter = Catmandu->exporter('YAML', file => $fh);
$exporter->add_many($arrayref);
$exporter->add_many($iterator);
$exporter->add_many(sub { });
$exporter->add($hashref);
printf "exported %d items\n" , $exporter->count;
like... add_many with an arrayref, with an iterator, with a sub β she takes them ALL. main character energy honestly. π
β¨ CONFIGURATION β¨
the options, the moment, the slay:
fileβ write that output to a local file, given by its path or a file handle. OR, plot twist π , you can pass a scalar reference to write into a string, or a code reference to write to a callback function. versatile icon.fhβ write the output to anIO::Handle. if you don't specify it,Catmandu::Util::iois used to create the output handle from the"file"argument, or by usingSTDOUT. she figures it out, don't worry. β¨fixβ anARRAYof one or more fixes, or file scripts, to be applied to exported items. glow-up those items before they leave the house. π§encodingβ the binmode of the output stream"fh". set to":utf8"by default, as she should. π«Ά
β¨ SEE ALSO β¨
go read these too, bestie, they're part of the family:
Catmandu::ExporterCatmandu::Importer::YAML
okay that's the whole page, no crumbs left. π this lil manual moment was served up by perl v5.40.1 on 2026-01-24, and it lives in the Catman...::YAML(3pm) section. periodt. πβ
π¦ 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