# perldoc > TAP::Parser::Iterator

---
type: CommandReference
command: TAP::Parser::Iterator
mode: perldoc
section: 3
source: perldoc
---

## Quick Reference

- `TAP::Parser::Iterator->new` — Create an iterator
- `$iter->next` — Iterate through items
- `$iter->next_raw` — Iterate raw input without syntax fixes (abstract)
- `$iter->wait` — Return wait status (abstract)
- `$iter->exit` — Return exit status (abstract)
- `$iter->handle_unicode` — Switch stream to handle Unicode (I/O handle only)
- `$iter->get_select_handles` — Return filehandles for select() readiness

## Name

Base class for TAP source iterators.  Version 3.43.

## Synopsis

perl
# to subclass:
use TAP::Parser::Iterator ();
use base 'TAP::Parser::Iterator';
sub _initialize {
    # see TAP::Object...
}
sub next_raw { ... }
sub wait     { ... }
sub exit     { ... }
## Methods

### Class Methods

- `new` — Create an iterator.  Provided by `TAP::Object`.

### Instance Methods

- `next` — `while ( my $item = $iter->next ) { ... }` Iterate through items.
- `next_raw` (abstract) — `while ( my $item = $iter->next_raw ) { ... }` Iterate raw input without applying fixes for quirky input syntax.
- `handle_unicode` — If necessary, switch the input stream to handle Unicode.  Only affects I/O handle based streams.  Default does nothing.
- `get_select_handles` — Return a list of filehandles that may be used upstream in a `select()` call to signal that this Iterator is ready.  Non-handle-based iterators should return an empty list.  Default does nothing.
- `wait` (abstract) — `my $wait_status = $iter->wait;` Return the wait status.
- `exit` (abstract) — `my $wait_status = $iter->exit;` Return the exit status.

### Subclassing

See "SUBCLASSING" in `TAP::Parser`.  You must override the abstract methods above.  For an example, see `TAP::Parser::Iterator::Array`.

## See Also

- `TAP::Object`
- `TAP::Parser`
- `TAP::Parser::Iterator::Array`
- `TAP::Parser::Iterator::Stream`
- `TAP::Parser::Iterator::Process`