{
    "mode": "perldoc",
    "parameter": "CPAN::Meta::Prereqs",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/CPAN%3A%3AMeta%3A%3APrereqs/json",
    "generated": "2026-06-11T13:35:00Z",
    "sections": {
        "NAME": {
            "content": "CPAN::Meta::Prereqs - a set of distribution prerequisites by phase and type\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.150010\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "A CPAN::Meta::Prereqs object represents the prerequisites for a CPAN distribution or one of its\noptional features. Each set of prereqs is organized by phase and type, as described in\nCPAN::Meta::Prereqs.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "new\nmy $prereq = CPAN::Meta::Prereqs->new( \\%prereqspec );\n\nThis method returns a new set of Prereqs. The input should look like the contents of the\n\"prereqs\" field described in CPAN::Meta::Spec, meaning something more or less like this:\n\nmy $prereq = CPAN::Meta::Prereqs->new({\nruntime => {\nrequires => {\n'Some::Module' => '1.234',\n...,\n},\n...,\n},\n...,\n});\n\nYou can also construct an empty set of prereqs with:\n\nmy $prereqs = CPAN::Meta::Prereqs->new;\n\nThis empty set of prereqs is useful for accumulating new prereqs before finally dumping the\nwhole set into a structure or string.\n\nrequirementsfor\nmy $requirements = $prereqs->requirementsfor( $phase, $type );\n\nThis method returns a CPAN::Meta::Requirements object for the given phase/type combination. If\nno prerequisites are registered for that combination, a new CPAN::Meta::Requirements object will\nbe returned, and it may be added to as needed.\n\nIf $phase or $type are undefined or otherwise invalid, an exception will be raised.\n\nphases\nmy @phases = $prereqs->phases;\n\nThis method returns the list of all phases currently populated in the prereqs object, suitable\nfor iterating.\n\ntypesin\nmy @runtimetypes = $prereqs->typesin('runtime');\n\nThis method returns the list of all types currently populated in the prereqs object for the\nprovided phase, suitable for iterating.\n\nwithmergedprereqs\nmy $newprereqs = $prereqs->withmergedprereqs( $otherprereqs );\n\nmy $newprereqs = $prereqs->withmergedprereqs( \\@otherprereqs );\n\nThis method returns a new CPAN::Meta::Prereqs objects in which all the other prerequisites given\nare merged into the current set. This is primarily provided for combining a distribution's core\nprereqs with the prereqs of one of its optional features.\n\nThe new prereqs object has no ties to the originals, and altering it further will not alter\nthem.\n\nmergedrequirements\nmy $newreqs = $prereqs->mergedrequirements( \\@phases, \\@types );\nmy $newreqs = $prereqs->mergedrequirements( \\@phases );\nmy $newreqs = $prereqs->mergedrequirements();\n\nThis method joins together all requirements across a number of phases and types into a new\nCPAN::Meta::Requirements object. If arguments are omitted, it defaults to \"runtime\", \"build\" and\n\"test\" for phases and \"requires\" and \"recommends\" for types.\n\nasstringhash\nThis method returns a hashref containing structures suitable for dumping into a distmeta data\nstructure. It is made up of hashes and strings, only; there will be no Prereqs,\nCPAN::Meta::Requirements, or \"version\" objects inside it.\n\nisfinalized\nThis method returns true if the set of prereqs has been marked \"finalized,\" and cannot be\naltered.\n\nfinalize\nCalling \"finalize\" on a Prereqs object will close it for further modification. Attempting to\nmake any changes that would actually alter the prereqs will result in an exception being thrown.\n\nclone\nmy $clonedprereqs = $prereqs->clone;\n\nThis method returns a Prereqs object that is identical to the original object, but can be\naltered without affecting the original object. Finalization does not survive cloning, meaning\nthat you may clone a finalized set of prereqs and then modify the clone.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Please report any bugs or feature using the CPAN Request Tracker. Bugs can be submitted through\nthe web interface at <http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Meta>\n\nWhen submitting a bug or request, please include a test-file or a patch to an existing test-file\nthat illustrates the bug or desired feature.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   David Golden <dagolden@cpan.org>\n\n*   Ricardo Signes <rjbs@cpan.org>\n\n*   Adam Kennedy <adamk@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and\nContributors.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
            "subsections": []
        }
    },
    "summary": "CPAN::Meta::Prereqs - a set of distribution prerequisites by phase and type",
    "flags": [],
    "examples": [],
    "see_also": []
}