{
    "mode": "perldoc",
    "parameter": "TAP::Parser::Source",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3ASource/json",
    "generated": "2026-06-12T04:38:09Z",
    "synopsis": "use TAP::Parser::Source;\nmy $source = TAP::Parser::Source->new;\n$source->raw( \\'reference to raw TAP source' )\n->config( \\%config )\n->merge( $boolean )\n->switches( \\@switches )\n->testargs( \\@args )\n->assemblemeta;\ndo { ... } if $source->meta->{isfile};\n# see assemblemeta for a full list of data available",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::Source - a TAP source & meta data about it\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.43\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use TAP::Parser::Source;\nmy $source = TAP::Parser::Source->new;\n$source->raw( \\'reference to raw TAP source' )\n->config( \\%config )\n->merge( $boolean )\n->switches( \\@switches )\n->testargs( \\@args )\n->assemblemeta;\n\ndo { ... } if $source->meta->{isfile};\n# see assemblemeta for a full list of data available\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "A TAP *source* is something that produces a stream of TAP for the parser to consume, such as an\nexecutable file, a text file, an archive, an IO handle, a database, etc. \"TAP::Parser::Source\"s\nencapsulate these *raw* sources, and provide some useful meta data about them. They are used by\nTAP::Parser::SourceHandlers, which do whatever is required to produce & capture a stream of TAP\nfrom the *raw* source, and package it up in a TAP::Parser::Iterator for the parser to consume.\n\nUnless you're writing a new TAP::Parser::SourceHandler, a plugin or subclassing TAP::Parser, you\nprobably won't need to use this module directly.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Class Methods",
                    "content": "\"new\"\nmy $source = TAP::Parser::Source->new;\n\nReturns a new \"TAP::Parser::Source\" object.\n"
                },
                {
                    "name": "Instance Methods",
                    "content": "\"raw\"\nmy $raw = $source->raw;\n$source->raw( $somevalue );\n\nChaining getter/setter for the raw TAP source. This is a reference, as it may contain large\namounts of data (eg: raw TAP).\n\n\"meta\"\nmy $meta = $source->meta;\n$source->meta({ %somevalue });\n\nChaining getter/setter for meta data about the source. This defaults to an empty hashref. See\n\"assemblemeta\" for more info.\n\n\"hasmeta\"\nTrue if the source has meta data.\n\n\"config\"\nmy $config = $source->config;\n$source->config({ %somevalue });\n\nChaining getter/setter for the source's configuration, if any has been provided by the user. How\nit's used is up to you. This defaults to an empty hashref. See \"configfor\" for more info.\n\n\"merge\"\nmy $merge = $source->merge;\n$source->config( $bool );\n\nChaining getter/setter for the flag that dictates whether STDOUT and STDERR should be merged\n(where appropriate). Defaults to undef.\n\n\"switches\"\nmy $switches = $source->switches;\n$source->config([ @switches ]);\n\nChaining getter/setter for the list of command-line switches that should be passed to the source\n(where appropriate). Defaults to undef.\n\n\"testargs\"\nmy $testargs = $source->testargs;\n$source->config([ @testargs ]);\n\nChaining getter/setter for the list of command-line arguments that should be passed to the\nsource (where appropriate). Defaults to undef.\n\n\"assemblemeta\"\nmy $meta = $source->assemblemeta;\n\nGathers meta data about the \"raw\" source, stashes it in \"meta\" and returns it as a hashref. This\nis done so that the TAP::Parser::SourceHandlers don't have to repeat common checks. Currently\nthis includes:\n\nisscalar => $bool,\nishash   => $bool,\nisarray  => $bool,\n\n# for scalars:\nlength => $n\nhasnewlines => $bool\n\n# only done if the scalar looks like a filename\nisfile => $bool,\nisdir  => $bool,\nissymlink => $bool,\nfile => {\n# only done if the scalar looks like a filename\nbasename => $string, # including ext\ndir      => $string,\next      => $string,\nlcext   => $string,\n# system checks\nexists  => $bool,\nstat    => [ ... ], # perldoc -f stat\nempty   => $bool,\nsize    => $n,\ntext    => $bool,\nbinary  => $bool,\nread    => $bool,\nwrite   => $bool,\nexecute => $bool,\nsetuid  => $bool,\nsetgid  => $bool,\nsticky  => $bool,\nisfile => $bool,\nisdir  => $bool,\nissymlink => $bool,\n# only done if the file's a symlink\nlstat      => [ ... ], # perldoc -f lstat\n# only done if the file's a readable text file\nshebang => $firstline,\n}\n\n# for arrays:\nsize => $n,\n\n\"shebang\"\nGet the shebang line for a script file.\n\nmy $shebang = TAP::Parser::Source->shebang( $somescript );\n\nMay be called as a class method\n\n\"configfor\"\nmy $config = $source->configfor( $class );\n\nReturns \"config\" for the $class given. Class names may be fully qualified or abbreviated, eg:\n\n# these are equivalent\n$source->configfor( 'Perl' );\n$source->configfor( 'TAP::Parser::SourceHandler::Perl' );\n\nIf a fully qualified $class is given, its abbreviated version is checked first.\n"
                }
            ]
        },
        "AUTHORS": {
            "content": "Steve Purkis.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "TAP::Object, TAP::Parser, TAP::Parser::IteratorFactory, TAP::Parser::SourceHandler\n",
            "subsections": []
        }
    },
    "summary": "TAP::Parser::Source - a TAP source & meta data about it",
    "flags": [],
    "examples": [],
    "see_also": []
}