{
    "mode": "perldoc",
    "parameter": "Template::Stash::XS",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Template%3A%3AStash%3A%3AXS/json",
    "generated": "2026-06-10T14:30:46Z",
    "synopsis": "use Template;\nuse Template::Stash::XS;\nmy $stash = Template::Stash::XS->new(\\%vars);\nmy $tt2   = Template->new({ STASH => $stash });",
    "sections": {
        "NAME": {
            "content": "Template::Stash::XS - High-speed variable stash written in C\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Template;\nuse Template::Stash::XS;\n\nmy $stash = Template::Stash::XS->new(\\%vars);\nmy $tt2   = Template->new({ STASH => $stash });\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The Template:Stash::XS module is an implementation of the Template::Stash written in C. The \"XS\"\nin the name refers to Perl's XS extension system for interfacing Perl to C code. It works just\nlike the regular Perl implementation of Template::Stash but runs about twice as fast.\n\nThe easiest way to use the XS stash is to configure the Template Toolkit to use it by default.\nYou can do this at installation time (when you run \"perl Makefile.PL\") by answering 'y' to the\nquestions:\n\nDo you want to build the XS Stash module?      y\nDo you want to use the XS Stash by default?    y\n\nSee the INSTALL file distributed with the Template Toolkit for further details on installation.\n\nIf you don't elect to use the XS stash by default then you should use the \"STASH\" configuration\nitem when you create a new Template object. This should reference an XS stash object that you\nhave created manually.\n\nuse Template;\nuse Template::Stash::XS;\n\nmy $stash = Template::Stash::XS->new(\\%vars);\nmy $tt2   = Template->new({ STASH => $stash });\n\nAlternately, you can set the $Template::Config::STASH package variable like so:\n\nuse Template;\nuse Template::Config;\n\n$Template::Config::STASH = 'Template::Stash::XS';\n\nmy $tt2 = Template->new();\n\nThe XS stash will then be automatically used.\n\nIf you want to use the XS stash by default and don't want to re-install the Template Toolkit,\nthen you can manually modify the \"Template/Config.pm\" module near line 42 to read:\n\n$STASH = 'Template::Stash::XS';\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Please report bugs to the Template Toolkit mailing list templates@template-toolkit.org\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Andy Wardley <abw@wardley.org> <http://wardley.org/>\n\nDoug Steinwand <dsteinwand@citysearch.com>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (C) 1996-2013 Andy Wardley. All Rights Reserved.\n\nThis module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Template::Stash\n",
            "subsections": []
        }
    },
    "summary": "Template::Stash::XS - High-speed variable stash written in C",
    "flags": [],
    "examples": [],
    "see_also": []
}