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";