Catman...::Mock(3pm)

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

🌸 NAME 🌸 β€” a whole exporter that does absolutely nothing

okay bestie, welcome to the Catman...::Mock(3pm) page, straight out of the User Contributed Perl Documentation πŸ’… and yes, the name is doing a little bit of trolling on purpose:

  • Catmandu::Exporter::Mock β€” an exporter that doesn't export anything πŸ™ˆβœ¨

like. that's the whole job. that's the assignment. and she ate. πŸ’€


✨ SYNOPSIS ✨

bestie you can run her from the commandline or from Perl, dealer's choice πŸŽ€

# From the commandline
$ catmandu convert JSON --fix myfixes to Mock < /tmp/data.json

# From Perl

use Catmandu;

# Print to STDOUT
my $exporter = Catmandu->exporter('Mock',fix => 'myfix.txt');

$exporter->add_many($arrayref);
$exporter->add_many($iterator);
$exporter->add_many(sub { });

$exporter->add($hashref);

printf "exported %d items\n" , $exporter->count;

# Get an array ref of all records exported
my $data = $exporter->as_arrayref;

notice how add_many will happily take an $arrayref, an $iterator, or a plain old sub { } πŸ‘‘ she's flexible like that.


πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• this exporter exports nothing. like, zero. nada. it is the void. it is the "no thoughts head empty" of exporters πŸ¦‹

you use it in situations where you, for example, export data from a fix β€” the vibes are immaculate, the output is nonexistent.

but WAIT. here's the plot twist that makes her main character energy πŸ‘‘: unlike the Null exporter, the Mock exporter keeps an internal array of all the records that got exported, and you can pull that whole array back out with the as_arrayref method. so she looks like she's doing nothing but she's secretly keeping receipts πŸŽ€πŸ’…


🌈 SEE ALSO 🌈

go say hi to her quieter sibling:

  • Catmandu::Exporter::Null

fr fr, if you came here looking for actual exported files: they're not coming. she said "no πŸ’–" and honestly? iconic.

okay that's the whole page bestie!! this was written by way of perl v5.40.1 and dated 2026-01-24, and the page itself is Catman...::Mock(3pm) 🫢 mwah, go forth and export nothing, you're doing amazing sweetie πŸ’œβœ¨

πŸ“¦ where this page comes from