Catman...terator(3pm)
π Catmandu::MultiIterator β the manual page, bestie edition π
okay so welcome to the Catmandu::MultiIterator page, from the User Contributed Perl Documentation collection. Strap in, it's short and it's iconic. π
β¨ NAME β¨
Catmandu::MultiIterator β chain multiple iterators together π¦
Like, you got a bunch of iterators. You want them to act like one iterator. That's it. That's the whole vibe. No cap. π
πΈ SYNOPSIS πΈ
Bestie, look how clean this is:
my $it = Catmandu::MultiIterator->new(
Catmandu::Importer::Mock->new,
Catmandu::Importer::Mock->new,
);
# return all the items of each importer in turn
$it->each(sub {
# ...
});
So you hand new a whole list of iterators β here it's two Catmandu::Importer::Mock objects, and yes the second one is literally the same thing again, that's the point, we're keeping it simple β and then you call each on the whole bundle. π«Ά
And the way it works? It returns all the items of each importer in turn β first iterator's items, then the next one's, then the next, all the way down. One big line of items, no interleaving, no drama. β
The sub there is where your per-item code goes, and the # ... is you, living your best life, doing whatever you need with each item. π
π METHODS π
All Catmandu::Iterable methods are available.
That's the whole section, bestie, and honestly? It ate. π₯ Every single method that Catmandu::Iterable gives you β you get it here too. No extra list to memorise, no gotchas, just the full inheritance situation doing its thing. iykyk. π
π Heads up: the original page doesn't spell out which methods those are, so if you need the actual list, go read the Catmandu::Iterable docs. This page is not gatekeeping, it's just literally not listing them. π
π§ Sign-off π§
This lil beauty was brought to you by perl v5.40.1, dated 2026-01-24, and it's filed under that very aesthetically truncated title Catman...terator(3pm) β because nothing says "I'm the main character" like a header that just gives up halfway through your name. π
Go chain your iterators, bestie. Periodt. ππβ¨
π¦ 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