Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Accessing the stash within a TT file

by juster (Friar)
on Jun 30, 2009 at 16:15 UTC ( #776089=note: print w/replies, xml ) Need Help??


in reply to Accessing the stash within a TT file

Are you sure you can't just use the PROCESS directive to process another template file?

The Template::Stash object appears to be accessible like this:

my $tt = Template->new(); my $stash = $tt->context()->stash();

Though I imagine you'd want to weaken the reference before passing it to process with weaken from Scalar::Util. The plugin might be a more elegant solution... [% PROCESS ... %] even more so.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://776089]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2020-02-19 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (80 votes). Check out past polls.

    Notices?