[ic] tv -- true temporary, non-session set/value tag
Josh Lavin
josh at perusion.com
Fri Apr 25 22:47:14 UTC 2014
Quoting Jon Jensen (jon at endpoint.com):
> On Sat, 22 Mar 2014, Mike Heins wrote:
>
> >commit 71224d2808601341c3d9c78778eba781ced2b082
> >Author: Mike Heins <mike at perusion.com>
> >Date: Sat Mar 22 09:53:25 2014 -0400
> [snip]
> >
> > The above three tags replace this scheme with values that are based in
> > the $Vend::Interpolate::Tmp space. These values are available in
> > embedded Perl with $Tmp, so are usable in the same fashion as $Scratch.
> > But they are truly temporary and will never be saved to a session.
> >
> > [ts VARNAME]VALUE[/ts]
> > ITL code in VALUE *is* interoplated prior to setting VARNAME in
> > $Tmp.
> >
> > [tn VARNAME]VALUE[/tn]
> > ITL code in VALUE is *not* interoplated prior to setting VARNAME in
> > $Tmp.
> >
> > [tv VARNAME]
> > Display value of VARNAME.
>
> Mike,
>
> Thanks for contributing this. Disentangling temporary values
> completely from the session is a nice move.
Anybody see anything wrong with adding this patch to support this with
the [if] tag?
Ala: [if tmp VARNAME] do something [/if]
Seems to work for me.
--- /tmp/Tx749d_Interpolate.pm 2014-04-25 18:44:55.296973999 -0400
+++ lib/Vend/Interpolate.pm 2014-04-25 18:44:32.507974150 -0400
@@ -990,6 +990,12 @@
if defined $comp;
delete $::Scratch->{$term};
}
+ elsif($base eq 'tmp') {
+ $op = qq%$Tmp->{$term}%;
+ $op = "q{$op}" unless defined $noop;
+ $op .= qq% $operator $comp%
+ if defined $comp;
+ }
elsif($base =~ /^e?value/) {
$op = qq%$::Values->{$term}%;
$op = "q{$op}" unless defined $noop;
--
Josh Lavin
Perusion -- Expert Interchange Consulting http://www.perusion.com/
... ask me about job opportunities ...
More information about the interchange-users
mailing list