The Template::Namespace::Constants module implements a namespace handler which is plugged into the Template::Directive compiler module. This then performs compile time constant folding of variables in a particular namespace.

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.