{
    "mode": "perldoc",
    "parameter": "vars",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/vars/json",
    "generated": "2026-06-14T00:16:25Z",
    "synopsis": "use vars qw($frob @mung %seen);",
    "sections": {
        "NAME": {
            "content": "vars - Perl pragma to predeclare global variable names\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use vars qw($frob @mung %seen);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "NOTE: For use with variables in the current package for a single scope, the functionality\nprovided by this pragma has been superseded by \"our\" declarations, available in Perl v5.6.0 or\nlater, and use of this pragma is discouraged. See \"our\" in perlfunc.\n\nThis pragma will predeclare all the variables whose names are in the list, allowing you to use\nthem under \"use strict\", and disabling any typo warnings for them.\n\nUnlike pragmas that affect the $^H hints variable, the \"use vars\" and \"use subs\" declarations\nare not lexically scoped to the block they appear in: they affect the entire package in which\nthey appear. It is not possible to rescind these declarations with \"no vars\" or \"no subs\".\n\nPackages such as the AutoLoader and SelfLoader that delay loading of subroutines within packages\ncan create problems with package lexicals defined using \"my()\". While the vars pragma cannot\nduplicate the effect of package lexicals (total transparency outside of the package), it can act\nas an acceptable substitute by pre-declaring global symbols, ensuring their availability to the\nlater-loaded routines.\n\nSee \"Pragmatic Modules\" in perlmodlib.\n",
            "subsections": []
        }
    },
    "summary": "vars - Perl pragma to predeclare global variable names",
    "flags": [],
    "examples": [],
    "see_also": []
}