saintmike has asked for the wisdom of the Perl Monks concerning the following question:
My assumption was that variables get stored in a Template::Stash object, but running the code below doesn't return the expected value 'bar'.
Any ideas on what I'm missing?
my $data_string = q{ [% foo = "bar" %] }; use Template; use Template::Stash; my $stash = Template::Stash->new(); my $tmpl = Template->new(STASH => $stash); my $out; $tmpl->process(\$data_string, {}, \$out) or die $tmpl->error(); print $stash->get('foo'), "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Accessing Template Toolkit Variables
by Util (Priest) on Sep 30, 2007 at 17:05 UTC | |
by ktowle (Initiate) on Oct 06, 2011 at 19:48 UTC | |
|
Re: Accessing Template Toolkit Variables
by Anonymous Monk on Sep 30, 2007 at 04:24 UTC | |
|
Re: Accessing Template Toolkit Variables
by Rhandom (Curate) on Oct 01, 2007 at 16:08 UTC |