Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Abstracting away layout details when using large HTML::Template-based sites?

by rhesa (Vicar)
on Dec 09, 2007 at 15:11 UTC ( #655964=note: print w/replies, xml ) Need Help??


in reply to Re^2: Abstracting away layout details when using large HTML::Template-based sites?
in thread Abstracting away layout details when using large HTML::Template-based sites?

I would also suggest HTML::Template::Compiled, but your filter solution is pretty nice too. You can work around the ENV variable by building a filter based on the variable, using an embedded sub:
sub mk_include_filter { my $page = shift; return sub { my $text_ref = shift; $$text_ref =~ s/###/$page/g; }; } my $template = HTML::Template->new(filename => 'layout.tmpl', filter => mk_include_filter('page.i +nc') );
  • Comment on Re^3: Abstracting away layout details when using large HTML::Template-based sites?
  • Download Code

Replies are listed 'Best First'.
Re^4: Abstracting away layout details when using large HTML::Template-based sites?
by skx (Parson) on Dec 09, 2007 at 16:21 UTC

    Thanks for that; I fiddled a couple of times and couldn't quite work out why it was failing. Your solution works properly ++.

    Steve
    --

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655964]
help
Chatterbox?
[marto]: that is a neat feature, I'll have to have a look at how it displays that
[Tux]: 14:32 Europe/Amsterdam, so good afternoon to you :)
[marto]: 13:32, sunny Glasgow :P
[Tux]: as in, some others might appreciate a good morning or goor evening
[Tux]: Glasgow, as in TPCiG-2018 !!!! :) :)
erix would rather appreciate proof of a goodmorning
[marto]: Tux so I'm told :)
[ww]: ww seconds erix view

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2017-09-22 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (263 votes). Check out past polls.

    Notices?