in reply to Re^4: Preparing data for Template
in thread Preparing data for Template
However, the values are not being passed back to the Template. Or, if they are, they are not getting displayed.
Here is an SSCCE to demonstrate looping over the return values:
#!/usr/bin/env perl use strict; use warnings; use Template; sub baz { return qw/there World/; } my $v = { bar => \&baz }; my $t = join '', <DATA>; Template->new->process (\$t, $v); __DATA__ [% FOREACH foo IN bar() %] Hello [% foo %]! [% END %]
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Preparing data for Template
by Bod (Parson) on Dec 31, 2020 at 12:41 UTC | |
by Corion (Patriarch) on Dec 31, 2020 at 12:48 UTC | |
by Bod (Parson) on Dec 31, 2020 at 12:57 UTC | |
by haukex (Archbishop) on Dec 31, 2020 at 13:27 UTC | |
by LanX (Saint) on Dec 31, 2020 at 14:34 UTC | |
by Corion (Patriarch) on Dec 31, 2020 at 13:25 UTC |