What will be the sequence of execution if these blocks are present in a Mason component?
%args
%init
%once
%shared
%attr
%flags
There are two different kinds of blocks in that list. "Executable" blocks, which contain executable perl code, and non-executable blocks, which contain key-value pairs (not unlike perl hashes).
<%once>
This block is executed whenever the component is loaded into memory. It is executed before any other block.
<%shared>
This block is executed once per request. It is executed before the <%init> block.
<%init>
This block is executed every time the component is called. It is executed before any other code except for code in <%once> or <%shared> blocks.
<%args>
This block is used to declare the arguments that a component expects. In addition, it can also be used to specify a default value if none is given when the component is called.
<%flags>
This block is used to declare special Mason flags, which are used to affect the component's behavior. Currently, there is only one flag defined,
inherit
.
<%attr>
This block is used to declare arbitrary key-value pairs. Unlike the <%flags> block, the contents are not used by Mason but may be used in your code.
For more information, see the Mason book, from which some of the above was copied (and modified) from.