{
    "mode": "perldoc",
    "parameter": "Exporter::Lite",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ALite/json",
    "generated": "2026-08-13T19:24:49Z",
    "synopsis": "package Foo;\nuse Exporter::Lite;\nour @EXPORT    = qw($This That);      # default exports\nour @EXPORTOK = qw(@Left %Right);    # optional exports\nThen in code using the module:\nuse Foo;\n# $This and &That are imported here\nYou have to explicitly ask for optional exports:\nuse Foo qw/ @Left %Right /;",
    "sections": {
        "NAME": {
            "content": "Exporter::Lite - lightweight exporting of functions and variables\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "package Foo;\nuse Exporter::Lite;\n\nour @EXPORT    = qw($This That);      # default exports\nour @EXPORTOK = qw(@Left %Right);    # optional exports\n\nThen in code using the module:\n\nuse Foo;\n# $This and &That are imported here\n\nYou have to explicitly ask for optional exports:\n\nuse Foo qw/ @Left %Right /;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Exporter::Lite is an alternative to Exporter, intended to provide a lightweight subset of the\nmost commonly-used functionality. It supports import(), @EXPORT and @EXPORTOK and not a whole\nlot else.\n\nExporter::Lite simply exports its import() function into your namespace. This might be called a\n\"mix-in\" or a \"role\".\n\nWhen \"Exporter::Lite\" was written, if you wanted to use \"Exporter\" you had to write something\nlike this:\n\nuse Exporter;\nour @ISA = qw/ Exporter /;\n\n\"Exporter::Lite\" saved you from writing that second line. But since before 2010 you've been able\nto write:\n\nuse Exporter qw/ import /;\n\nWhich imports the \"import\" function into your namespace from \"Exporter\". As a result, I would\nrecommend that you use \"Exporter\" now, as it's a core module (shipped with Perl).\n\nTo make sure you get a version of \"Exporter\" that supports the above usage, specify a minimum\nversion when you \"use\" it:\n\nuse Exporter 5.57 qw/ import /;\n\nBack to \"Exporter::Lite\"\nSetting up a module to export its variables and functions is simple:\n\npackage My::Module;\nuse Exporter::Lite;\n\nour @EXPORT = qw($Foo bar);\n\nFunctions and variables listed in the @EXPORT package variable are automatically exported if you\nuse the module and don't explicitly list any imports. Now, when you \"use My::Module\", $Foo and",
            "subsections": [
                {
                    "name": "bar",
                    "content": "Optional exports are listed in the @EXPORTOK package variable:\n\npackage My::Module;\nuse Exporter::Lite;\n\nour @EXPORTOK = qw($Foo bar);\n\nWhen My::Module is used, $Foo and bar() will *not* show up, unless you explicitly ask for them:\n\nuse My::Module qw($Foo bar);\n\nNote that when you specify one or more functions or variables to import, then you must also\nexplicitly list any of the default symbols you want to use. So if you have an exporting module:\n\npackage Games;\nour @EXPORT    = qw/ pacman defender  /;\nour @EXPORTOK = qw/ galaga centipede /;\n\nThen if you want to use both \"pacman\" and \"galaga\", then you'd write:\n\nuse Games qw/ pacman galaga /;\n"
                }
            ]
        },
        "Methods": {
            "content": "Export::Lite has one public method, import(), which is called automatically when your modules is",
            "subsections": [
                {
                    "name": "use",
                    "content": "In normal usage you don't have to worry about this at all.\n\nimport\nSome::Module->import;\nSome::Module->import(@symbols);\n\nWorks just like Exporter::import() excepting it only honors @Some::Module::EXPORT and\n@Some::Module::EXPORTOK.\n\nThe given @symbols are exported to the current package provided they are in\n@Some::Module::EXPORT or @Some::Module::EXPORTOK. Otherwise an exception is thrown (ie. the\nprogram dies).\n\nIf @symbols is not given, everything in @Some::Module::EXPORT is exported.\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "'\"%s\" is not exported by the %s module'\nAttempted to import a symbol which is not in @EXPORT or @EXPORTOK.\n\n'Can\\'t export symbol: %s'\nAttempted to import a symbol of an unknown type (ie. the leading $@% salad wasn't\nrecognized).\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Exporter is the grandaddy of all Exporter modules, and bundled with Perl itself, unlike the rest\nof the modules listed here.\n\nAttribute::Exporter defines attributes which you use to mark which subs and variables you want\nto export, and how.\n\nExporter::Simple also uses attributes to control the export of functions and variables from your\nmodule.\n\nConst::Exporter makes it easy to create a module that exports constants.\n\nConstant::Exporter is another module that makes it easy to create modules that define and export\nconstants.\n\nSub::Exporter is a \"sophisticated exporter for custom-built routines\"; it lets you provide\ngenerators that can be used to customise what gets imported when someone uses your module.\n\nExporter::Tiny provides the same features as Sub::Exporter, but relying only on core\ndependencies.\n\nExporter::Shiny is a shortcut for Exporter::Tiny that provides a more concise notation for\nproviding optional exports.\n\nExporter::Declare provides syntactic sugar to make the export status of your functions part of\ntheir declaration. Kind of.\n\nAppConfig::Exporter lets you export part of an AppConfig-based configuration.\n\nExporter::Lexical lets you export lexical subs from your module.\n\nConstant::Export::Lazy lets you write a module that exports function-style constants, which are\ninstantiated lazily.\n\nExporter::Auto will export everything from your module that it thinks is a public function (name\ndoesn't start with an underscore).\n\nClass::Exporter lets you export class methods as regular subroutines.\n\nXporter is like Exporter, but with persistent defaults and auto-ISA.\n",
            "subsections": []
        },
        "REPOSITORY": {
            "content": "<https://github.com/neilb/Exporter-Lite>\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Michael G Schwern <schwern@pobox.com>\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nSee http://www.perl.com/perl/misc/Artistic.html\n",
            "subsections": []
        }
    },
    "summary": "Exporter::Lite - lightweight exporting of functions and variables",
    "flags": [],
    "examples": [],
    "see_also": []
}