tmp — temporarily set value of scratch variable, with interpolation


Attribute Pos. Req. Default Description
name Yes Yes Name of the temporary scratch variable.
interpolate     1 interpolate input?
reparse     1 interpolate output?
hide     0 Hide the tag return value?


The tag sets value of the named temporary scratch variable.

The variable is temporary in a way that Interchange adds its name to the list of variables to delete directly after the current page is processed and served. Except for being part of good design, temporary variables also speed up session write time in many cases.

By default, the provided value is interpolated before assignment. To not interpolate contents, use [tmpn] or provide interpolate=0 attribute to this tag.


This tag does not appear to be affected by, or affect, the rest of Interchange.


No examples are available at this time. We do consider this a problem and will try to supply some.


See scratch glossary entry for a complete discussion.


tmp is available in Interchange versions:

4.6.0-5.9.0 (git-head)


Interchange 5.9.0:

Source: code/SystemTag/tmp.coretag
Lines: 15

# Copyright 2002-2007 Interchange Development Group and others
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# $Id: tmp.coretag,v 1.5 2007-03-30 23:40:49 pajamian Exp $

UserTag tmp                 Order        name
UserTag tmp                 hasEndTag
UserTag tmp                 Interpolate
UserTag tmp                 PosNumber    1
UserTag tmp                 Version      $Revision: 1.5 $
UserTag tmp                 MapRoutine   Vend::Interpolate::set_tmp

Source: lib/Vend/
Lines: 5250

sub set_tmp {
my($var,$val) = @_;
push @Vend::TmpScratch, $var;
  $::Scratch->{$var} = $val;
return '';


Interchange Development Group



DocBook! Interchange!