We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a variable is used in a FOREACH loop, it's value after the loop will be the last value of the loop.
For example, if we have a variable @letters containing a, b, and c:
@letters
a
b
c
[% SET x = "x" %] [% x %] <!-- will print "x" --> [% FOREACH x IN letters %} [% x $] [% END %] [% x %] <!-- will print "c" -->
Contrasted with Perl:
my $x = "x"; foreach $x ( @letters ) { say $x; } say $x; # will print "x"
I think a reasonable solution would be a configuration option ( or a keyword ) to localize the loop variable.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When a variable is used in a FOREACH loop, it's value after the loop will be the last value of the loop.
For example, if we have a variable
@letters
containinga
,b
, andc
:Contrasted with Perl:
I think a reasonable solution would be a configuration option ( or a keyword ) to localize the loop variable.
The text was updated successfully, but these errors were encountered: