{
    "content": [
        {
            "type": "text",
            "text": "# HTML::Template::FAQ (perldoc)\n\n## NAME\n\nHTML::Template::FAQ - Frequently Asked Questions about HTML::Template\n\n## SYNOPSIS\n\nIn the interest of greater understanding I've started a FAQ section of the perldocs. Please look\nin here before you send me email.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **FREQUENTLY ASKED QUESTIONS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "HTML::Template::FAQ",
        "section": "",
        "mode": "perldoc",
        "summary": "HTML::Template::FAQ - Frequently Asked Questions about HTML::Template",
        "synopsis": "In the interest of greater understanding I've started a FAQ section of the perldocs. Please look\nin here before you send me email.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "FREQUENTLY ASKED QUESTIONS",
                "lines": 103,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "HTML::Template::FAQ - Frequently Asked Questions about HTML::Template\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "In the interest of greater understanding I've started a FAQ section of the perldocs. Please look\nin here before you send me email.\n",
                "subsections": []
            },
            "FREQUENTLY ASKED QUESTIONS": {
                "content": "Is there a place to go to discuss HTML::Template and/or get help?\nThere's a mailing-list for discussing HTML::Template at\nhtml-template-users@lists.sourceforge.net. Join at:\n\nhttp://lists.sourceforge.net/lists/listinfo/html-template-users\n\nIf you just want to get email when new releases are available you can join the announcements\nmailing-list here:\n\nhttp://lists.sourceforge.net/lists/listinfo/html-template-announce\n\nIs there a searchable archive for the mailing-list?\nYes, you can find an archive of the SourceForge list here:\n\nhttp://dir.gmane.org/gmane.comp.lang.perl.modules.html-template\n\nI want support for <TMPLXXX>! How about it?\nMaybe. I definitely encourage people to discuss their ideas for HTML::Template on the mailing\nlist. Please be ready to explain to me how the new tag fits in with HTML::Template's mission to\nprovide a fast, lightweight system for using HTML templates.\n\nNOTE: Offering to program said addition and provide it in the form of a patch to the most recent\nversion of HTML::Template will definitely have a softening effect on potential opponents!\n\nI found a bug, can you fix it?\nThat depends. Did you send me the VERSION of HTML::Template, a test script and a test template?\nIf so, then almost certainly.\n\nIf you're feeling really adventurous, HTML::Template is publicly available on GitHub\n(https://github.com/mpeters/html-template). Please feel free to fork it and send me a pull\nrequest with any changes you have.\n\n<TMPLVAR>s from the main template aren't working inside a <TMPLLOOP>! Why?\nThis is the intended behavior. \"<TMPLLOOP>\" introduces a separate scope for \"<TMPLVAR>s\" much\nlike a subroutine call in Perl introduces a separate scope for \"my\" variables.\n\nIf you want your \"<TMPLVAR>\"s to be global you can set the \"globalvars\" option when you call\n\"new()\". See above for documentation of the \"globalvars\" \"new()\" option.\n\nHow can I pre-load my templates using cache-mode and modperl?\nAdd something like this to your startup.pl:\n\nuse HTML::Template;\nuse File::Find;\n\nprint STDERR \"Pre-loading HTML Templates...\\n\";\nfind(\nsub {\nreturn unless /\\.tmpl$/;\nHTML::Template->new(\nfilename => \"$File::Find::dir/$\",\ncache    => 1,\n);\n},\n'/path/to/templates',\n'/another/path/to/templates/'\n);\n\nNote that you'll need to modify the \"return unless\" line to specify the extension you use for\nyour template files - I use .tmpl, as you can see. You'll also need to specify the path to your\ntemplate files.\n\nOne potential problem: the /path/to/templates/ must be EXACTLY the same path you use when you\ncall \"HTML::Template->new()\". Otherwise the cache won't know they're the same file and will load\na new copy - instead getting a speed increase, you'll double your memory usage. To find out if\nthis is happening set \"cachedebug =\" 1> in your application code and look for \"CACHE MISS\"\nmessages in the logs.\n\nWhat characters are allowed in TMPL* names?\nNumbers, letters, '.', '/', '+', '-' and ''.\n\nHow can I execute a program from inside my template?\nShort answer: you can't. Longer answer: you shouldn't since this violates the fundamental\nconcept behind HTML::Template - that design and code should be separate.\n\nBut, inevitably some people still want to do it. If that describes you then you should take a\nlook at HTML::Template::Expr. Using HTML::Template::Expr it should be easy to write a\n\"runprogram()\" function. Then you can do awful stuff like:\n\n<tmplvar expr=\"runprogram('foo.pl')\">\n\nJust, please, don't tell me about it. I'm feeling guilty enough just for writing\nHTML::Template::Expr in the first place.\n\nWhat's the best way to create a <select> form element using HTML::Template?\nThere is much disagreement on this issue. My personal preference is to use CGI.pm's excellent\n\"popupmenu()\" and \"scrollinglist()\" functions to fill in a single \"<tmplvar selectfoo>\"\nvariable.\n\nTo some people this smacks of mixing HTML and code in a way that they hoped HTML::Template would\nhelp them avoid. To them I'd say that HTML is a violation of the principle of separating design\nfrom programming. There's no clear separation between the programmatic elements of the \"<form>\"\ntags and the layout of the \"<form>\" tags. You'll have to draw the line somewhere - clearly the\ndesigner can't be entirely in charge of form creation.\n\nIt's a balancing act and you have to weigh the pros and cons on each side. It is certainly\npossible to produce a \"<select>\" element entirely inside the template. What you end up with is a\nrat's nest of loops and conditionals. Alternately you can give up a certain amount of\nflexibility in return for vastly simplifying your templates. I generally choose the latter.\n\nAnother option is to investigate HTML::FillInForm which some have reported success using to\nsolve this problem.\n",
                "subsections": []
            }
        }
    }
}