Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

template::namespace::constants(3) [centos man page]

Template::Namespace::Constants(3)			User Contributed Perl Documentation			 Template::Namespace::Constants(3)

NAME
Template::Namespace::Constants - Compile time constant folding SYNOPSIS
# easy way to define constants use Template; my $tt = Template->new({ CONSTANTS => { pi => 3.14, e => 2.718, }, }); # nitty-gritty, hands-dirty way use Template::Namespace::Constants; my $tt = Template->new({ NAMESPACE => { constants => Template::Namespace::Constants->new({ pi => 3.14, e => 2.718, }, }, }); DESCRIPTION
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. METHODS
new(\%constants) 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. my $handler = Template::Namespace::Constants->new({ pi => 3.14, e => 2.718, }); ident(@ident) 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. AUTHOR
Andy Wardley <abw@wardley.org> <http://wardley.org/> COPYRIGHT
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template::Directive perl v5.16.3 2011-12-20 Template::Namespace::Constants(3)

Check Out this Related Man Page

Template::Constants(3pm)				User Contributed Perl Documentation				  Template::Constants(3pm)

NAME
Template::Constants - Defines constants for the Template Toolkit SYNOPSIS
use Template::Constants qw( :status :error :all ); DESCRIPTION
The "Template::Constants" modules defines, and optionally exports into the caller's namespace, a number of constants used by the Template package. Constants may be used by specifying the "Template::Constants" package explicitly: use Template::Constants; print Template::Constants::STATUS_DECLINED; Constants may be imported into the caller's namespace by naming them as options to the "use Template::Constants" statement: use Template::Constants qw( STATUS_DECLINED ); print STATUS_DECLINED; Alternatively, one of the following tagset identifiers may be specified to import sets of constants: '":status"', '":error"', '":all"'. use Template::Constants qw( :status ); print STATUS_DECLINED; Consult the documentation for the "Exporter" module for more information on exporting variables. EXPORTABLE TAG SETS
The following tag sets and associated constants are defined: :status STATUS_OK # no problem, continue STATUS_RETURN # ended current block then continue (ok) STATUS_STOP # controlled stop (ok) STATUS_DONE # iterator is all done (ok) STATUS_DECLINED # provider declined to service request (ok) STATUS_ERROR # general error condition (not ok) :error ERROR_RETURN # return a status code (e.g. 'stop') ERROR_FILE # file error: I/O, parse, recursion ERROR_UNDEF # undefined variable value used ERROR_PERL # error in [% PERL %] block ERROR_FILTER # filter error ERROR_PLUGIN # plugin error :chomp # for PRE_CHOMP and POST_CHOMP CHOMP_NONE # do not remove whitespace CHOMP_ONE # remove whitespace to newline CHOMP_ALL # old name for CHOMP_ONE (deprecated) CHOMP_COLLAPSE # collapse whitespace to a single space CHOMP_GREEDY # remove all whitespace including newlines :debug DEBUG_OFF # do nothing DEBUG_ON # basic debugging flag DEBUG_UNDEF # throw undef on undefined variables DEBUG_VARS # general variable debugging DEBUG_DIRS # directive debugging DEBUG_STASH # general stash debugging DEBUG_CONTEXT # context debugging DEBUG_PARSER # parser debugging DEBUG_PROVIDER # provider debugging DEBUG_PLUGINS # plugins debugging DEBUG_FILTERS # filters debugging DEBUG_SERVICE # context debugging DEBUG_ALL # everything DEBUG_CALLER # add caller file/line info DEBUG_FLAGS # bitmap used internally :all All the above constants. AUTHOR
Andy Wardley <abw@wardley.org> <http://wardley.org/> COPYRIGHT
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template, "Exporter" perl v5.14.2 2011-12-20 Template::Constants(3pm)
Man Page