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 by TAP::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 a select() 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 the wait status for this iterator.
my $wait_status = $iter->wait;
  • exit β€” note: this method is abstract and should be overridden. ⚠️ Return the exit status 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::Object
  • TAP::Parser
  • TAP::Parser::Iterator::Array
  • TAP::Parser::Iterator::Stream
  • TAP::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