[%# # IMPORTANT NOTE # This documentation is generated automatically from source # templates. Any changes you make here may be lost. # # The 'docsrc' documentation source bundle is available for download # from http://www.template-toolkit.org/docs.html and contains all # the source templates, XML files, scripts, etc., from which the # documentation for the Template Toolkit is built. -%] [% META book = 'Modules' page = 'Constants' %] [% WRAPPER toc; INCLUDE tocitem title = 'SYNOPSIS'; INCLUDE tocitem title = 'DESCRIPTION'; INCLUDE tocitem title = 'EXPORTABLE TAG SETS'; INCLUDE tocitem title = 'AUTHOR'; INCLUDE tocitem title = 'VERSION'; INCLUDE tocitem title = 'COPYRIGHT'; INCLUDE tocitem title = 'SEE ALSO'; END %] [% WRAPPER section title='SYNOPSIS' -%]

        use Template::Constants qw( :status :error :all );

[%- END %] [% WRAPPER section title='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;

See [% ttlink('Exporter') -%] for more information on exporting variables.

[%- END %] [% WRAPPER section title='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 [% tt_start_tag %] PERL [% tt_end_tag %] block

      :chomp                      # for PRE_CHOMP and POST_CHOMP
        CHOMP_NONE                # do not remove whitespace
        CHOMP_ALL                 # remove whitespace
        CHOMP_COLLAPSE            # collapse whitespace to a single space

      :all         All the above constants.

[%- END %] [% WRAPPER section title='AUTHOR' -%]

Andy Wardley <abw@kfs.org>

[% ttlink('http://www.andywardley.com/', 'http://www.andywardley.com/') -%]

[%- END %] [% WRAPPER section title='VERSION' -%]

2.32, distributed as part of the Template Toolkit version 2.06, released on 07 November 2001.

[%- END %] [% WRAPPER section title='COPYRIGHT' -%]

      Copyright (C) 1996-2001 Andy Wardley.  All Rights Reserved.
      Copyright (C) 1998-2001 Canon Research Centre Europe Ltd.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

[%- END %] [% WRAPPER section title='SEE ALSO' -%]

[% ttlink('Template', 'Template') -%], [% ttlink('CPAN::Exporter', 'CPAN::Exporter') -%]

[%- END %]