TAP::PARSER::ITERATOR(3perl)
π TAP::Parser::Iterator β the lil base class energy behind every TAP source iterator π
okay so bestie, welcome to the 3perl manual for TAP::Parser::Iterator. This is the base class, the blueprint, the mother of all TAP source iterators. She's not doing the work herself β she's the vibe, the interface, the standard. π
β¨ VERSION β¨
Version 3.52 β yes she's grown, she's evolved, she's iconic.
π SYNOPSIS π
Subclassing? Say less. Here's the whole vibe:
# to subclass:
use TAP::Parser::Iterator ();
use base 'TAP::Parser::Iterator';
sub _initialize {
# see TAP::Object...
}
sub next_raw { ... }
sub wait { ... }
sub exit { ... }
That's it, that's the blueprint. Copy it, make it yours. π«Ά
π¦ DESCRIPTION π¦
So here's the tea: this is a simple iterator base class that defines TAP::Parser's iterator API. That's literally her whole job. She sets the rules, you do the work.
And where do these iterators come from, you ask? They're typically created from TAP::Parser::SourceHandlers. That's the pipeline, iykyk. π
β METHODS β
π Class Methods π
newβ Create an iterator. Babygirl, this one is provided byTAP::Object, so it's already handled for you. Don't reinvent her.
π Instance Methods π
nextβ iterate through it, of course. Obviously. Duh.
while ( my $item = $iter->next ) { ... }
next_rawβ okay listen, note: this method is abstract and should be overridden. π¨ She's giving "placeholder energy" until you show up and implement her.
while ( my $item = $iter->next_raw ) { ... }
She iterates raw input β meaning without applying any fixes for quirky input syntax. No filter, no glow-up, straight from the source. π
handle_unicodeβ if necessary, switch the input stream to handle unicode. Important detail bestie: this only has any effect for I/O handle based streams. The default implementation? Does nothing. Cute, low-effort, we respect it.get_select_handlesβ returns a list of filehandles that may be used upstream in aselect()call, to signal that this Iterator is ready. π If your iterator isn't handle-based, she should return an empty list β know your lane. The default implementation here also does nothing.waitβ note: this method is abstract and should be overridden. β οΈ Return thewaitstatus for this iterator.
my $wait_status = $iter->wait;
exitβ note: this method is abstract and should be overridden. β οΈ Return theexitstatus for this iterator.
my $wait_status = $iter->exit;
π§ SUBCLASSING π§
Want the full overview? Go read "SUBCLASSING" in TAP::Parser. She's got the deep dive, we're just the trailer. π¬
But fr fr β you must override the abstract methods as noted above. No skipping, no shortcuts, we see you. π
πΈ Example πΈ
TAP::Parser::Iterator::Array is probably the easiest example to follow. And honestly? There's not much point repeating it here. Go look at the source, bestie, she's right there. π«Ά
π₯ SEE ALSO π₯
TAP::ObjectTAP::ParserTAP::Parser::Iterator::ArrayTAP::Parser::Iterator::StreamTAP::Parser::Iterator::Process
That's the whole page, bestie. This was TAP::Parser::Iterator, from perl v5.44.0, dated 2026-10-17. Stay iterating, stay iconic, slay the subclassing. periodt. π
β¨π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND 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