{
    "content": [
        {
            "type": "text",
            "text": "# Env (man)\n\n## NAME\n\nEnv - perl module that imports environment variables as scalars or arrays\n\n## SYNOPSIS\n\nuse Env;\nuse Env qw(PATH HOME TERM);\nuse Env qw($SHELL @LDLIBRARYPATH);\n\n## DESCRIPTION\n\nPerl maintains environment variables in a special hash named %ENV.  For when this access\nmethod is inconvenient, the Perl module \"Env\" allows environment variables to be treated as\nscalar or array variables.\n\n## TLDR\n\n> Show the environment or run a program in a modified environment.\n\n- Show the environment:\n  `env`\n- Run a program. Often used in scripts after the shebang (#!) for looking up the path to the program:\n  `env {{program}}`\n- Clear the environment and run a program:\n  `env {{-i|--ignore-environment}} {{program}}`\n- Remove variable from the environment and run a program:\n  `env {{-u|--unset}} {{variable}} {{program}}`\n- Set a variable and run a program:\n  `env {{variable}}={{value}} {{program}}`\n- Set one or more variables and run a program:\n  `env {{variable1=value variable2=value variable3=value ...}} {{program}}`\n- Run a program under a different name:\n  `env {{-a|--argv0}} {{custom_name}} {{program}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **LIMITATIONS**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Env",
        "section": "",
        "mode": "man",
        "summary": "Env - perl module that imports environment variables as scalars or arrays",
        "synopsis": "use Env;\nuse Env qw(PATH HOME TERM);\nuse Env qw($SHELL @LDLIBRARYPATH);",
        "tldr_summary": "Show the environment or run a program in a modified environment.",
        "tldr_examples": [
            {
                "description": "Show the environment",
                "command": "env"
            },
            {
                "description": "Run a program. Often used in scripts after the shebang (#!) for looking up the path to the program",
                "command": "env {{program}}"
            },
            {
                "description": "Clear the environment and run a program",
                "command": "env {{-i|--ignore-environment}} {{program}}"
            },
            {
                "description": "Remove variable from the environment and run a program",
                "command": "env {{-u|--unset}} {{variable}} {{program}}"
            },
            {
                "description": "Set a variable and run a program",
                "command": "env {{variable}}={{value}} {{program}}"
            },
            {
                "description": "Set one or more variables and run a program",
                "command": "env {{variable1=value variable2=value variable3=value ...}} {{program}}"
            },
            {
                "description": "Run a program under a different name",
                "command": "env {{-a|--argv0}} {{custom_name}} {{program}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 43,
                "subsections": []
            },
            {
                "name": "LIMITATIONS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Env - perl module that imports environment variables as scalars or arrays\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Env;\nuse Env qw(PATH HOME TERM);\nuse Env qw($SHELL @LDLIBRARYPATH);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Perl maintains environment variables in a special hash named %ENV.  For when this access\nmethod is inconvenient, the Perl module \"Env\" allows environment variables to be treated as\nscalar or array variables.\n\nThe \"Env::import()\" function ties environment variables with suitable names to global Perl\nvariables with the same names.  By default it ties all existing environment variables (\"keys\n%ENV\") to scalars.  If the \"import\" function receives arguments, it takes them to be a list\nof variables to tie; it's okay if they don't yet exist. The scalar type prefix '$' is\ninferred for any element of this list not prefixed by '$' or '@'. Arrays are implemented in\nterms of \"split\" and \"join\", using $Config::Config{pathsep} as the delimiter.\n\nAfter an environment variable is tied, merely use it like a normal variable.  You may access\nits value\n\n@path = split(/:/, $PATH);\nprint join(\"\\n\", @LDLIBRARYPATH), \"\\n\";\n\nor modify it\n\n$PATH .= \":/any/path\";\npush @LDLIBRARYPATH, $dir;\n\nhowever you'd like. Bear in mind, however, that each access to a tied array variable requires\nsplitting the environment variable's string anew.\n\nThe code:\n\nuse Env qw(@PATH);\npush @PATH, '/any/path';\n\nis almost equivalent to:\n\nuse Env qw(PATH);\n$PATH .= \":/any/path\";\n\nexcept that if $ENV{PATH} started out empty, the second approach leaves it with the (odd)\nvalue \"\":/any/path\"\", but the first approach leaves it with \"\"/any/path\"\".\n\nTo remove a tied environment variable from the environment, assign it the undefined value\n\nundef $PATH;\nundef @LDLIBRARYPATH;\n",
                "subsections": []
            },
            "LIMITATIONS": {
                "content": "On VMS systems, arrays tied to environment variables are read-only. Attempting to change\nanything will cause a warning.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Chip Salzenberg <chip@fin.uucp> and Gregor N. Purdy <gregor@focusresearch.com>\n\n\n\nperl v5.34.0                                 2025-07-25                                   Env(3perl)",
                "subsections": []
            }
        }
    }
}