Adjustment of a site
<form action = "tunning.html">
Color of a background: <input name=BG>
Color of a font: <input name=FN>
<input type=submit name=GO>
</form>
<%init>
if ($ARGS {'GO'}) {
* Check of the entered fields
if ($ARGS {'BG'}! ~ / ^ [dw] + $ / || $ARGS {'FN'}! ~ / ^ [dw] + $/) {
$m-> comp (".outmesg", MESG => " the data " are incorrectly entered);
}
else {
$r-> headers_out-> add ('Set-Cookie', " BG = $ ARGS {'BG'} ");
$r-> headers_out-> add ('Set-Cookie', " FN = $ ARGS {'FN'} ");
$m-> comp (".outmesg", MESG => " Installations are saved ");
}
}
</%init>
Teg <%def> describes a component in a component.
Figure 1. index.html
Figure 2. Structure of a simple site
Last strokes
To exclude an opportunity of a call internal a component, it is necessary to add in a configuration file of a line:
PerlModule Apache:: Constants
<FilesMatch " ^ _ |autohandler ">
SetHandler perl-script
PerlInitHandler Apache:: Constants:: NOT_FOUND
</FilesMatch>
It will protect internal components from a undesirable call from a browser. But in this case all internal components should begin with a symbol "_".
The conclusion
More detailed information can be learned{be found out} from the documentation to the module (perldoc HTML:: Mason:: Devel, perldoc HTML:: Mason:: Admin).
About HTML:: Mason in clause{article} it is said it is far from being all. But it is already enough to resulted information to estimate advantages of this module. Diligence of developers have not passed for nothing. This module has already had time to take is far from being the latest place in the list of popular web-technologies.

|