> Where I'm getting hosed is that %config and %session have data
> I need visible to the Text::Template objects themselves.  I've
> RTFM'ed until my eyes are pink, and I see no options short of
> copying variables wholesale into another Package, but then I
> still can't get at them and "use strict" can I?

Text::Template has a flexible interface.  Put everything into a specific
package, or use the HASH option to fill_in().  Use references, not copies.

Your sample code has some stuff in it that looks a little scary to me.  Do
you really want to make %config, %dispatcher, $page, $frame, $command,
%session, and  %templates into class variables?  Maybe instance variables
would make more sense.  (These are closures variables as well, so they'll
keep their values from one request to the next.)  And building methods that
change class variables instead of actually returning something is kind of
obfuscated.  But maybe I just don't understand what you're doing from these
small snippets.

- Perrin

Reply via email to