Bill Moseley wrote:
> On Sat, Jan 29, 2005 at 10:22:35PM +0100, Johan Vromans wrote:
> > Yes, it is possible to construct the 'real' current directory using
> > the template source directory and the path name of the current
> > template, but this is cumbersome.
> 
> I had a similar question a while back.  (My quick look showed that
> Template::Provider::_load() didn't set a "path" template variable
> (only name, relative to include path).

What if you modified Template::Provider (load() or fetch() or whatever)
to remember the specific path from INCLUDE_PATH that was successful for
any given template? The "template" and "component" global vars could be
used to store this info, e,g, "template.path". Then you could substitute
that value for "." in your subsequent file I/O operations.

I'm not much good at hacking the TT core, but maybe someone out there
who is could write such a patch for Template::Provider...

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to