|> Home > Documentation > Latest documentation > Interchange tags > var|
Tag expansion example
or similarly with positional parameters:
Direct access to variables is a lot more efficient, i.e. using the __VARNAME__ (local), @@VARNAME@@ (global) or @_VARNAME_@ (local falling back to global), so you should only use this tag where the direct access is unavailable, such as within DirConfig variable files.
Local UserTags, Subs, ActionMaps and other embedded Perl code etc. have direct access to the $Variable hashref for local Variables, but must use $Tag->var('VARNAME',1) to look up the value of global variables.
Global UserTags, GlobalSubs and ActionMaps etc. have direct access to the $::Variable hashref for local Variables, and also have access to the $Global::Variable hashref for global Variables, so they shouldn't need to use this tag at all.
The name of the Variable to display.
Use one of the following values here:
The "global" parameter's default value is "0".
Setting filter="filter1 filter2" modifies the output by running it through the specified filter(s).
See the filters category for a list of standard filters.