The following is a table of what is returned in each context copied from the Template::Alloy pod.
return values smart context list context item context
------------- ------------- ------------ ------------
A 'foo' 'foo' 'foo' 'foo'
B undef undef undef undef
C (no return value) undef [] undef
D (7) 7 7 7
E (7,8,9) 7,8,9 7,8,9 9
F @a = (7) 7 7 1
G @a = (7,8,9) 7,8,9 7,8,9 3
H ({b=>"c"}) {b=>"c"} {b=>"c"} {b=>"c"}
I (1) 1 [1] 1
J (1,2) [1,2] [1,2] 2
K 7,8,9 7,8,9 [7,8,9] 7,8,9
L (undef, "foo") die "foo" undef, "foo" "foo"
M wantarray?1:0 1 1 0
Disclaimer: I am the author.
In reply to Re: Template Toolkit 2 strange behaviour
by Rhandom
in thread Template Toolkit 2 strange behaviour
by Aramis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |