{
    "mode": "perldoc",
    "parameter": "parent",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/parent/json",
    "generated": "2026-06-11T08:49:34Z",
    "synopsis": "package Baz;\nuse parent qw(Foo Bar);",
    "sections": {
        "NAME": {
            "content": "parent - Establish an ISA relationship with base classes at compile time\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "package Baz;\nuse parent qw(Foo Bar);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Allows you to both load one or more modules, while setting up inheritance from those modules at\nthe same time. Mostly similar in effect to\n\npackage Baz;\nBEGIN {\nrequire Foo;\nrequire Bar;\npush @ISA, qw(Foo Bar);\n}\n\nBy default, every base class needs to live in a file of its own. If you want to have a subclass\nand its parent class in the same file, you can tell \"parent\" not to load any modules by using\nthe \"-norequire\" switch:\n\npackage Foo;\nsub exclaim { \"I CAN HAS PERL\" }\n\npackage DoesNotLoadFooBar;\nuse parent -norequire, 'Foo', 'Bar';\n# will not go looking for Foo.pm or Bar.pm\n\nThis is equivalent to the following code:\n\npackage Foo;\nsub exclaim { \"I CAN HAS PERL\" }\n\npackage DoesNotLoadFooBar;\npush @DoesNotLoadFooBar::ISA, 'Foo', 'Bar';\n\nThis is also helpful for the case where a package lives within a differently named file:\n\npackage MyHash;\nuse Tie::Hash;\nuse parent -norequire, 'Tie::StdHash';\n\nThis is equivalent to the following code:\n\npackage MyHash;\nrequire Tie::Hash;\npush @ISA, 'Tie::StdHash';\n\nIf you want to load a subclass from a file that \"require\" would not consider an eligible\nfilename (that is, it does not end in either \".pm\" or \".pmc\"), use the following code:\n\npackage MySecondPlugin;\nrequire './plugins/custom.plugin'; # contains Plugin::Custom\nuse parent -norequire, 'Plugin::Custom';\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "This module was forked from base to remove the cruft that had accumulated in it.\n",
            "subsections": []
        },
        "CAVEATS": {
            "content": "",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "base\nparent::versioned\nA fork of parent that provides version checking in parent class modules.\n",
            "subsections": []
        },
        "AUTHORS AND CONTRIBUTORS": {
            "content": "Rafaël Garcia-Suarez, Bart Lateur, Max Maischein, Anno Siegel, Michael Schwern\n",
            "subsections": []
        },
        "MAINTAINER": {
            "content": "Max Maischein \" corion@cpan.org \"\n\nCopyright (c) 2007-2017 Max Maischein \"<corion@cpan.org>\" Based on the idea of \"base.pm\", which\nwas introduced with Perl 5.00404.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This module is released under the same terms as Perl itself.\n",
            "subsections": []
        }
    },
    "summary": "parent - Establish an ISA relationship with base classes at compile time",
    "flags": [],
    "examples": [],
    "see_also": []
}