Catman...::Multi(3pm)

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

πŸŽ€ Catmandu::Exporter::Multi(3pm) β€” NAME πŸŽ€

okay so the header at the top of your terminal is gonna call this page Catman...::Multi(3pm) (truncated, mysterious, honestly kind of iconic) but its actual government name is:

Catmandu::Exporter::Multi β€” export your data to multiple exporters πŸ’–

that's the whole vibe. one exporter is cute, but why pick when you can have all of them. no cap.


✨ SYNOPSIS ✨

bestie look at this. this will write both a CSV and an XLS file:

# this will write both a CSV and an XLS file
my $exporter = Catmandu::Exporter::Multi->new(exporters => [
    Catmandu::Exporter::CSV->new(file => 'mydata.csv'),
    Catmandu::Exporter::XLS->new(file => 'mydata.xls'),
]);
$exporter->add({col1 => 'val1', col2 => 'val2'});
$exporter->commit;

so here's the tea πŸ«– β€” you build your little squad of exporters, hand the whole array over to Catmandu::Exporter::Multi->new under the exporters key, and then you just talk to the one exporter like it's the group chat. add your data, commit at the end, and everybody in the squad gets it. not me being obsessed with a one-to-many relationship that actually works 😭

  • exporters β€” the array of exporter objects you're feeding your data into. in the example that's a Catmandu::Exporter::CSV pointed at 'mydata.csv' and a Catmandu::Exporter::XLS pointed at 'mydata.xls'.
  • add β€” you give it a hashref of your data, like {col1 => 'val1', col2 => 'val2'}.
  • commit β€” the final boss step. do it. don't skip it. 🏁
reminder that the two files in the example are 'mydata.csv' and 'mydata.xls' β€” literal filenames, literal vibes, don't come for me πŸ’…

🌈 SEE ALSO 🌈

  • Catmandu::Exporter β€” the parent energy. go say hi. πŸ‘‘

and that's the page, bestie!! 🌸 this one's from perl v5.40.1, dated 2026-01-24, and the header/footer both spell it Catman...::Multi(3pm) because terminals love a dramatic ellipsis. mwah, go export everything at once, you're doing amazing sweetie πŸ¦‹πŸ’‹

πŸ“¦ where this page comes from