Templat...onstants(3)

πŸ’– NAME πŸ’–

okay bestie, welcome to Templat...onstants(3) from User Contributed Perl Documentation β€” this is the page for Template::Constants, and it defines constants for the Template Toolkit. slay. πŸ’…


✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

The Template::Constants module defines a bunch of constants used by the Template package, and it can optionally export them into the caller's namespace. cute, useful, iconic. πŸŽ€

You can use the constants by spelling out the Template::Constants package explicitly:

use Template::Constants;
print Template::Constants::STATUS_DECLINED;

You can also import constants into your own namespace by naming them as options to the use Template::Constants statement:

use Template::Constants qw( STATUS_DECLINED );
print STATUS_DECLINED;

Alternatively, you can specify one of these tagset identifiers to import whole sets of constants: ':status', ':error', ':all'.

use Template::Constants qw( :status );
print STATUS_DECLINED;

Want the full lore on exporting variables? Consult the documentation for the Exporter module. it's giving reference material, and honestly? valid. πŸ“šβœ¨


🌈 EXPORTABLE TAG SETS 🌈

The following tag sets and associated constants are defined β€” here's the whole roster, no cap:

  • :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 πŸ‘‘

the icon behind this page is Andy Wardley <abw@wardley.org> <http://wardley.org/>. periodt. πŸ’œ


Copyright (C) 1996-2022 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"


that's the whole page, bestie πŸ’– this one's from perl v5.42.0, dated 2024-06-23 β€” go be iconic with your constants 🌈✨

πŸ“¦ where this page comes from