[htmltmpl] filter question
Brought to you by:
samtregar
From: Chisel W. <ch...@he...> - 2003-11-20 11:19:16
|
Hi, I've just hit a mental block, and I don't know if it's something that's not possible, or I'm just being stupid. I'm using H::T wrapped inside a package: sub template($$) { ... $self->{'tpl'} = HTML::Template->new( ... 'filter' => [ { 'sub' => \&_filter_sections, 'format' => 'scalar' }, ], ); } What'd I'd like to do is have access to $self in _filter_sections() so I can have something along these lines: sub _filter_sections { ... my $section = $self->{'_conf'}{'section'} || 'some default value'; $$textref =~ s/\[%\s+section\s+%\]/$section/g; } I've read the H::T podumentation, and can't see anything that says this is possible. Is it? If not any suggestions how to achieve the same effect a different way. I'm loathe to use gloabal variables unless I really have to, Thanks in advance, Chisel -- e: ch...@he... | The Victorian game of knocking on w: http://www.herlpacker.co.uk/ | somebody's door and running away is gpg: D167E7FE | called "Parcel Force". |