Catman...terator(3pm)

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

πŸ’– 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