The Catmandu::Iterable class provides many list methods to Iterators such as Importers and Exporters. Most of the methods are lazy if the underlying datastream supports it. Beware of idempotence: many iterators contain state information and calls will give different results on a second invocation.

Returns a copy of the Iterator and executing callback on each item. This method works like the Unix tee command. Use this command to peek into an iterable while it is processing results. E.g. you are writing code to process an iterable and wrote something like:

$it->each(sub {
# Very complicated routine
....
});

Now you would like to benchmark this piece of code (how fast are we processing). This can be done by tapping into the iterator and calling a 'benchmark' subroutine in your program that for instance counts the number of items divided by the execution time.