Catman...::Text(3pm)
π NAME π
Catmandu::Exporter::Text β a Text exporter, bestie π
(and yeah, this whole page is straight out of the User Contributed Perl Documentation for Catman...::Text(3pm), okurrr)
β¨ SYNOPSIS β¨
# From the command line
# Write all field values as a line of Text
$ catmandu convert JSON to Text --field_sep "," < data.json
# In a Perl script
use Catmandu;
# Print to STDOUT
my $exporter = Catmandu->exporter('Text', fix => 'myfix.txt');
# Print to file or IO::Handle
my $exporter = Catmandu->exporter('Text', file => '/tmp/out.yml');
my $exporter = Catmandu->exporter('Text', file => $fh);
$exporter->add_many($arrayref);
$exporter->add_many($iterator);
$exporter->add_many(sub { });
$exporter->add($hashref);
printf "exported %d items\n" , $exporter->count;
πΈ DESCRIPTION πΈ
okay so this Catmandu::Exporter is literally the chillest one β it exports items as raw text. every single field value it finds in your data gets glued together, and field_sep is the lil delimiter doing the gluing. no cap. π«Ά
π CONFIGURATION π
fileβ write your output to a local file, and you can hand it over either by its path or by a file handle. OR (plot twist β¨) you can pass a scalar reference to write to a string, or a code reference to write to a callback function. iconic behavior honestly.fhβ write the output to anIO::Handle. if you don't specify one,Catmandu::Util::iogets called in to make the output handle from thefileargument, or it just falls back toSTDOUT. slay.fixβ anARRAYof one or more fixes or file scripts that get applied to the exported items. yes bestie, plural, stack 'em πencodingβ the binmode of the output streamfh. defaults to":utf8"out of the box. cute.line_sepSTR β use STR at each end of line. defaults to"\n"and honestly? same.field_sepSTR β use STR at each end of a field. (this is the one from the SYNOPSIS, remember--field_sep ","? yeah, her. π)
π¦ SEE ALSO π¦
Catmandu::ExporterCatmandu::Importer::Text
lowkey go read those two if you wanna complete the vibe, iykyk π
mwah π that's the whole page. this was perl v5.40.1, dated 2026-01-24, and it's the Catman...::Text(3pm) era β thanks for reading to the end, bestie, you ate that fr fr πβ¨
π¦ 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