{
    "mode": "perldoc",
    "parameter": "HTML::Mason",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/HTML%3A%3AMason/json",
    "generated": "2026-06-12T10:51:04Z",
    "synopsis": "PerlModule HTML::Mason::ApacheHandler\n<Location />\nSetHandler perl-script\nPerlHandler HTML::Mason::ApacheHandler\n</Location>",
    "sections": {
        "NAME": {
            "content": "HTML::Mason - High-performance, dynamic web site authoring system\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 1.59\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "PerlModule HTML::Mason::ApacheHandler\n\n<Location />\nSetHandler perl-script\nPerlHandler HTML::Mason::ApacheHandler\n</Location>\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Mason is a tool for building, serving and managing large web sites. Its features make it an\nideal backend for high load sites serving dynamic content, such as online newspapers or database\ndriven e-commerce sites.\n\nActually, Mason can be used to generate any sort of text, whether for a web site or not. But it\nwas originally built for web sites and since that's why most people are interested in it, that\nis the focus of this documentation.\n\nMason's various pieces revolve around the notion of \"components''. A component is a mix of HTML,\nPerl, and special Mason commands, one component per file. So-called \"top-level\" components\nrepresent entire web-pages, while smaller components typically return HTML snippets for\nembedding in top-level components. This object-like architecture greatly simplifies site\nmaintenance: change a shared component, and you instantly changed all dependent pages that refer\nto it across a site (or across many virtual sites).\n\nMason's component syntax lets designers separate a web page into programmatic and design\nelements. This means the esoteric Perl bits can be hidden near the bottom of a component,\npreloading simple variables for use above in the HTML. In our own experience, this frees content\nmanagers (i.e., non-programmers) to work on the layout without getting mired in programming\ndetails. Techies, however, still enjoy the full power of Perl.\n\nMason works by intercepting innocent-looking requests (say, http://www.yoursite.com/index.html)\nand mapping them to requests for Mason components. Mason then compiles the component, runs it,\nand feeds the output back to the client.\n\nConsider this simple Mason component:\n\n% my $noun = 'World';\nHello <% $noun %>!\nHow are ya?\n\nThe output of this component is:\n\nHello World!\nHow are ya?\n\nIn this component you see a mix of standard HTML and Mason elements. The bare '%' prefixing the\nfirst line tells Mason that this is a line of Perl code. One line below, the embedded <% ... %>\ntag gets replaced with the return value of its contents, evaluated as a Perl expression.\n\nBeyond this trivial example, components can also embed serious chunks of Perl code (say, to pull\nrecords from a database). They can also call other components, cache results for later reuse,\nand perform all the tricks you expect from a regular Perl program.\n",
            "subsections": []
        },
        "MAINTENANCE HELP NEEDED": {
            "content": "I (Dave Rolsky) am no longer using HTML::Mason and I would love to find some co-maintainers to\nhelp. Specifically, I'd like people to review issues and PRs, create new PRs, and ultimately\ntake on the task of uploading new releases to CPAN. If you're interested the best way to start\nis to fix one or more of the issues in the issue tracker\n<https://github.com/houseabsolute/HTML-Mason/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc>.\n\nWAIT - HAVE YOU SEEN MASON 2?\nVersion 1 of Mason (this distribution) -- has been around since 1998, is in wide use, and is\nvery stable. However it has not changed much in years and is no longer actively developed.\n\nVersion 2 of Mason -- Mason -- was released in February of 2011. It offers a new syntax as well\nas a number of other features. See\n<https://metacpan.org/pod/distribution/Mason/lib/Mason/Manual/UpgradingFromMason1.pod> for\ndetails of the differences between the two.\n",
            "subsections": []
        },
        "INSTALLATION": {
            "content": "Mason has been tested under Linux, FreeBSD, Solaris, HPUX, and Win32. As an all-Perl solution,\nit should work on any machine that has working versions of Perl 5.00503+, modperl, and the\nrequired CPAN modules.\n\nMason has a standard MakeMaker-driven installation. See the README file for details.\n",
            "subsections": []
        },
        "CONFIGURING MASON": {
            "content": "This section assumes that you are able to install and configure a modperl server. Relevant\ndocumentation is available at http://www.apache.org (Apache) and http://perl.apache.org\n(modperl). The modperl mailing list, archive, and guide are also great resources.\n\nThe simplest configuration of Mason requires a few lines in your httpd.conf:\n\nPerlModule HTML::Mason::ApacheHandler\n\n<Location />\nSetHandler perl-script\nPerlHandler HTML::Mason::ApacheHandler\n</Location>\n\nThe PerlModule directive simply ensures that the Mason code is loaded in the parent process\nbefore forking, which can save some memory when running modperl.\n\nThe <Location> section routes all requests to the Mason handler, which is a simple way to try\nout Mason. A more refined setup is discussed in the Controlling Access via Filename Extension\nsection of the administrator's manual.\n\nOnce you have added the configuration directives, restart the server. First, go to a standard\nURL on your site to make sure you haven't broken anything. If all goes well you should see the\nsame page as before. If not, recheck your Apache config files and also tail your server's error\nlog.\n\nIf you are getting \"404 Not Found\" errors even when the files clearly exist, Mason may be having\ntrouble with your document root. One situation that will unfortunately confuse Mason is if your\ndocument root goes through a symbolic link. Try expressing your document root in terms of the\ntrue filesystem path.\n\nNext, try adding the tag <% 2+2 %> at the top of some HTML file. If you reload this page and see\na \"4\", Mason is working!\n",
            "subsections": []
        },
        "DOCUMENTATION ROADMAP": {
            "content": "Once Mason is on its feet, the next step is to write a component or two. The Mason Developer's\nManual is a complete tutorial for writing, using, and debugging components. A reference\ncompanion to the Developer's Manual is the Request API documentation, HTML::Mason::Request.\n\nWhoever is responsible for setting up and tuning Mason should read the Administrator's Manual,\nthough developers will also benefit from reading it as well. This document covers more advanced\nconfiguration scenarios and performance optimization. The reference companion to the\nAdministrator's manual is the Parameters Reference, which describes all the parameters you can\nuse to configure Mason.\n\nMost of this documentation assumes that you're running Mason on top of modperl, since that is\nthe most common configuration. If you would like to run Mason via a CGI script, refer to the\nHTML::Mason::CGIHandler documentation. If you are using Mason from a standalone program, refer\nto the Using Mason from a Standalone Script section of the administrator's manual.\n\nThere is also a book about Mason, *Embedding Perl in HTML with Mason*, by Dave Rolsky and Ken\nWilliams, published by O'Reilly and Associates. The book's website is at\nhttp://www.masonbook.com/. This book goes into detail on a number of topics, and includes a\nchapter of recipes as well as a sample Mason-based website.\n",
            "subsections": []
        },
        "GETTING HELP AND SOURCES": {
            "content": "Questions and feedback are welcome, and should be directed to the Mason mailing list. You must\nbe subscribed to post.\n\nhttps://lists.sourceforge.net/lists/listinfo/mason-users\n\nYou can also visit us at \"#mason\" on <irc://irc.perl.org/#mason>.\n\nBugs and feature requests will be tracked at RT:\n\nhttp://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-Mason\nbug-html-mason@rt.cpan.org\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs may be submitted at <https://github.com/houseabsolute/HTML-Mason/issues>.\n\nI am also usually active on IRC as 'autarch' on \"irc://irc.perl.org\".\n",
            "subsections": []
        },
        "SOURCE": {
            "content": "The source code repository for HTML-Mason can be found at\n<https://github.com/houseabsolute/HTML-Mason>.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   Jonathan Swartz <swartz@pobox.com>\n\n*   Dave Rolsky <autarch@urth.org>\n\n*   Ken Williams <ken@mathforum.org>\n",
            "subsections": []
        },
        "CONTRIBUTORS": {
            "content": "*   Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\n*   Alex Balhatchet <kaoru@slackwise.net>\n\n*   Alex Vandiver <alex@chmrr.net>\n\n*   Florian Schlichting <fsfs@debian.org>\n\n*   John Williams <jwilliams@cpan.org>\n\n*   Kent Fredric <kentnl@gentoo.org>\n\n*   Kevin Falcone <falcone@bestpractical.com>\n\n*   Patrick Kane <modus-cpan@pr.es.to>\n\n*   Ricardo Signes <rjbs@cpan.org>\n\n*   Shlomi Fish <shlomif@shlomifish.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is copyright (c) 1998 - 2020 by Jonathan Swartz.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n\nThe full text of the license can be found in the LICENSE file included with this distribution.\n",
            "subsections": []
        }
    },
    "summary": "HTML::Mason - High-performance, dynamic web site authoring system",
    "flags": [],
    "examples": [],
    "see_also": []
}