{
    "mode": "perldoc",
    "parameter": "TAP::Parser::Multiplexer",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3AMultiplexer/json",
    "generated": "2026-06-09T23:09:42Z",
    "synopsis": "use TAP::Parser::Multiplexer;\nmy $mux = TAP::Parser::Multiplexer->new;\n$mux->add( $parser1, $stash1 );\n$mux->add( $parser2, $stash2 );\nwhile ( my ( $parser, $stash, $result ) = $mux->next ) {\n# do stuff\n}",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.43\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use TAP::Parser::Multiplexer;\n\nmy $mux = TAP::Parser::Multiplexer->new;\n$mux->add( $parser1, $stash1 );\n$mux->add( $parser2, $stash2 );\nwhile ( my ( $parser, $stash, $result ) = $mux->next ) {\n# do stuff\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"TAP::Parser::Multiplexer\" gathers input from multiple TAP::Parsers. Internally it calls select\non the input file handles for those parsers to wait for one or more of them to have input\navailable.\n\nSee TAP::Harness for an example of its use.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Class Methods",
                    "content": "\"new\"\nmy $mux = TAP::Parser::Multiplexer->new;\n\nReturns a new \"TAP::Parser::Multiplexer\" object.\n"
                },
                {
                    "name": "Instance Methods",
                    "content": "\"add\"\n$mux->add( $parser, $stash );\n\nAdd a TAP::Parser to the multiplexer. $stash is an optional opaque reference that will be\nreturned from \"next\" along with the parser and the next result.\n\n\"parsers\"\nmy $count   = $mux->parsers;\n\nReturns the number of parsers. Parsers are removed from the multiplexer when their input is\nexhausted.\n\n\"next\"\nReturn a result from the next available parser. Returns a list containing the parser from which\nthe result came, the stash that corresponds with that parser and the result.\n\nmy ( $parser, $stash, $result ) = $mux->next;\n\nIf $result is undefined the corresponding parser has reached the end of its input (and will\nautomatically be removed from the multiplexer).\n\nWhen all parsers are exhausted an empty list will be returned.\n\nif ( my ( $parser, $stash, $result ) = $mux->next ) {\nif ( ! defined $result ) {\n# End of this parser\n}\nelse {\n# Process result\n}\n}\nelse {\n# All parsers finished\n}\n\nSee Also\nTAP::Parser\n\nTAP::Harness\n"
                }
            ]
        }
    },
    "summary": "TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers",
    "flags": [],
    "examples": [],
    "see_also": []
}