Prev: Next: Up: Global directives[Contents][Index]


11.4.9 The Constant statement

The Constant statement defines a configuration constant for use in string expansions and Lua code. For a detailed description of configuration constants and their use, Providing constants for Lua code,

Global directive: Constant "name" "val"

Define constant name to have the value val.

Global directive: Constant "name" options

Define constant name and assign its value depending on options, as described in the table below:

-file "filename"

Read the contents of the file filename, and assign it to the constant. The contents is treated as an opaque binary string. The file is read exactly once, at program startup.

-filewatch "filename"

Same as -file, except that the file is monitored for changes during the runtime. Whenever the file changes, the constant will be updated, without the need to restart the program. See File-based Conditions, for a detailed discussion of this feature.

-trim

Used with one of the above, instructs pound to treat filename as a plain text file, and remove from its contents all trailing whitespace characters, i.e. horizontal tabulation (ASCII 9), newline (ASCII 10), vertical tabulation (ASCII 11), form feed (ASCII 12), carriage return (ASCII 13), and space (ASCII 32).