[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: difference between [perl] and [calc]
Hi Kyle -
> The Perl script gets the length of the _uninterpolated_ string. All I
> can guess is that the interpolate flag is applied differently than I
> thought. I understood that all MV tags would be interpolated and then
> the resulting string would be "eval"ed in Perl. I guessed incorrectly.
>
> This clears up a lot of small problems I have had over the last couple of
> weeks:
>
> [perl interpolate=1] != [calc] !!!!!
>
> So, now I need to go and replace a bunch of [perl] tags with [calc]...
> Sigh. This is quite annoying as I need to run some [perl] code on
> elements in the 'values' hash, but I need some interpolated values too.
Don't know the answer to the interpolate problem, but you can work around
it using tag_data() to get what you need:
[perl]
my $msg = tag_data( 'session', 'ship_message' );
return length($msg);
[/perl]
You can get a fair amount of info into perl tags without interpolation,
using things like tag_data(), $Safe{'values'}{'somevar'},
$Safe{'scratch'}{'somevar'}, etc.
Larry Leszczynski
larryl@furph.com
--
furph, Inc. WWW/Unix/Windows Solutions 734-513-7763 (voice)
info@furph.com http://www.furph.com 734-513-7759 (FAX)