Catman...xporter(3pm)
π Catmandu::TabularExporter π
okay bestie, gather round, because this one is a role β and she's the Catmandu::TabularExporter, living her best life in the 3pm section of the manual, shipped with the User Contributed Perl Documentation. she's the base role that tabular exporters (think CSV and her whole girl gang) inherit from, and she's lowkey iconic π
β¨ DESCRIPTION β¨
so like, for the base functionality of this role, you wanna go look at Catmandu::Exporter β that's the blueprint, the origin story, the mothership π«Ά
what Catmandu::TabularExporter does on top of that is add a little something extra: functionality that's tailored specifically for tabular or columnar exporters. rows and columns energy. spreadsheet core. periodt π
πΈ CONFIGURATION πΈ
these are the knobs you get to twist, bestie. let's go one by one π¦
fieldsβ the fields that are gonna be mapped. you can hand her an arrayref, an example hashref, or just a plain old comma separated string β she's flexible like that π. if you don't give her anything, she'll just use the fields of the first record she encounters. but ifcollect_fieldsis true? then she collects all the field names in the record stream first. main character planning ahead β¨columnsβ optional custom column labels, for when you want your headers to eat π . same deal asfields: arrayref, example hashref, or comma separated string.collect_fieldsβ peep thefieldsdescription above, that's where the tea is β. but heads up, bestie, because this option will cause all records in the stream to be buffered in memory β like, all of them, at once π. so like, be mindful. that's a lot of vibes to hold at one time.headerβ include a header with the column names. enabled by default π (yes queen, she comes correct right out of the box).
ngl, that collect_fields memory thing is the one to watch. buffering the whole stream is giving "holding everyone's emotional baggage" π proceed accordingly.
and that's the whole page, bestie, you ate it up π this lil' slice of the docs is from perl v5.40.1, dated 2026-01-24 β so go forth and export your tables, 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