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 a select() 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::Object
  • TAP::Parser
  • TAP::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