Catman...xporter(3pm)

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

πŸ’– 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 if collect_fields is 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 as fields: arrayref, example hashref, or comma separated string.
  • collect_fields β€” peep the fields description 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