<?php
define("ABS_PATH", $_SERVER['DOCUMENT_ROOT']);
include(ABS_PATH . "/head_nav.php");
include(ABS_PATH . "/middle.php");
?>
          <div class="section">
            <div class="toc-wrapper">
              <span class="toc-title">Contents:</span>
              <ul class="toc">
                <li class=""><a href="#SYNOPSIS">SYNOPSIS</a></li>
                <li class=""><a href="#DESCRIPTION">DESCRIPTION</a></li>
                <li class=""><a href="#METHODS">METHODS</a></li>
                <li class="sub"><a href="#method_new">new(\%constants)</a></li>
                <li class="sub"><a href="#method_ident">ident(\@ident)</a></li>
                <li class=""><a href="#AUTHOR">AUTHOR</a></li>
                <li class=""><a href="#COPYRIGHT">COPYRIGHT</a></li>
                <li class=""><a href="#SEE_ALSO">SEE ALSO</a></li>
              </ul>
            </div>
          </div>
          
                <div class="pod">
            <div class="section">
              <div class="head">
                <h1 id="SYNOPSIS">SYNOPSIS</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <pre># easy way to define constants
use Template;

my $tt = Template-&gt;new({
    CONSTANTS =&gt; {
        pi =&gt; 3.14,
        e  =&gt; 2.718,
    },
});

# nitty-gritty, hands-dirty way
use Template::Namespace::Constants;

my $tt = Template-&gt;new({
    NAMESPACE =&gt; {
        constants =&gt; Template::Namespace::Constants-&gt;new({
            pi =&gt; 3.14,
            e  =&gt; 2.718,
        },
    },
});</pre>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="DESCRIPTION">DESCRIPTION</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      The <code>Template::Namespace::Constants</code> module implements a
                      namespace handler which is plugged into the
                      <code>Template::Directive</code> compiler module. This then performs
                      compile time constant folding of variables in a particular namespace.
                    </p>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="METHODS">METHODS</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <div class="subsection">
                  <div class="head">
                    <h2 id="method_new" class="method" onclick="switch_subsection(this)" title="Click title to show/hide sub-section content.">new(\%constants)</h2>
                    <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
                  </div>
                  <div class="body">
                    <p>
                          The new() constructor method creates and returns a reference to a new
                          Template::Namespace::Constants object. This creates an internal stash to
                          store the constant variable definitions passed as arguments.
                        </p>
                        <pre>my $handler = Template::Namespace::Constants-&gt;new({
    pi =&gt; 3.14,
    e  =&gt; 2.718,
});</pre>
                  </div>
                </div>    <div class="subsection">
                  <div class="head">
                    <h2 id="method_ident" class="method" onclick="switch_subsection(this)" title="Click title to show/hide sub-section content.">ident(\@ident)</h2>
                    <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
                  </div>
                  <div class="body">
                    <p>
                          Method called to resolve a variable identifier into a compiled form. In
                          this case, the method fetches the corresponding constant value from its
                          internal stash and returns it.
                        </p>
                  </div>
                </div>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="AUTHOR">AUTHOR</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      Andy Wardley &lt;abw@wardley.org&gt; <a
                      href="https://wardley.org/">https://wardley.org/</a>
                    </p>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="COPYRIGHT">COPYRIGHT</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
                    </p>
                    <p>
                      This module is free software; you can redistribute it and/or modify it
                      under the same terms as Perl itself.
                    </p>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="SEE_ALSO">SEE ALSO</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      <a href="../../../modules/Template/Directive.php">Template::Directive</a>
                    </p>
              </div>
            </div>
            
            </div>
<?php include(ABS_PATH . "/footer.php"); ?>
