TAP::Pa...Process(3pm)
π TAP::Parser::Iterator::Process β a.k.a. the "run somebody else's program and read its output" iterator
Hii bestie, welcome to the page for TAP::Parser::Iterator::Process, one of the modules that ships in the Perl Programmers Reference Guide (that's the manual collection this page lives in, iykyk). No cap, this is a real one, and we're gonna get through it together π«Ά
β¨ NAME β¨
TAP::Parser::Iterator::Process β literally an iterator for process-based TAP sources. That's the whole vibe π
π VERSION π
Version 3.50 β periodt.
π¦ SYNOPSIS π¦
Okay so here's the lil sneak peek of how you'd actually use it:
use TAP::Parser::Iterator::Process;
my %args = (
command => ['python', 'setup.py', 'test'],
merge => 1,
setup => sub { ... },
teardown => sub { ... },
);
my $it = TAP::Parser::Iterator::Process->new(\%args);
my $line = $it->next;
That's it, that's the whole mood πΈ
π DESCRIPTION π
This is a simple iterator wrapper for executing external processes, and it's used by TAP::Parser. Nothing deeper than that, she's just a wrapper doing her job β¨
Real talk though: unless you're writing a plugin or subclassing, you probably won't need to use this module directly. It's very much giving "backstage crew, not main character" π
π METHODS π
π Class Methods
π "new"
Create an iterator. She expects one argument β a hashref β shaped exactly like this:
command => \@command_to_execute
merge => $attempt_merge_stderr_and_stdout?
setup => $callback_to_setup_command
teardown => $callback_to_teardown_command
And here's the lil implementation tea β: it tries to use IPC::Open3 & IO::Select to communicate with the spawned process if they are available. If they're not around, it falls back onto open(). Either way, it's gonna talk to that process, bestie π«Ά
π§ Instance Methods
"next"β iterate through the process output, of course. Like, obviously. That's her whole thing π"next_raw"β iterate raw input without applying any fixes for quirky input syntax. No touch-ups, no filter, raw and unfiltered π"wait"β get the wait status for this iterator's process. The "how'd it go" check-in β³"exit"β get the exit status for this iterator's process. The receipts, basically π§Ύ"handle_unicode"β upgrade the input stream to handle UTF8. Slay, she's multilingual now π"get_select_handles"β return a list of filehandles that may be used upstream in aselect()call to signal that this Iterator is ready. And if the iterator isn't handle based? She just returns an empty list. Respect the boundaries π
π ATTRIBUTION π
Originally ripped off from Test::Harness. Credit where credit is due, we stan an honest origin story π
β SEE ALSO β
TAP::ObjectTAP::ParserTAP::Parser::Iterator
Go read those too, bestie, they're all connected, iykyk π¦
Okay bye, ily, go test something π β this page came to you from perl v5.42.3, dated 2026-11-03, and that's the whole <rainbow>TAP::Pa...Process(3pm)</rainbow> situation. Slay π
β¨
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms