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:   [EMAIL PROTECTED]      |      The Victorian game of knocking on
w:   http://www.herlpacker.co.uk/ |     somebody's door and running away is
gpg: D167E7FE                     |            called "Parcel Force".


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to