This is in response to my recent questions about conf file use and key
fallback in tt.  I am thinking it would be nice to have something like

[% CONF hash = preferences.$ext %]

where $ext could be pl (for files to include via perl do), yaml (for YAML
files), sto (for Storable files), xml (yes, for xml files), perhaps split
(for simple space delimited key value pair files), etc.

The CONF directive (not married to that name) would then walk the include
path in reverse, convert the files to a ref, and fold subsequent refs on
top.  The later keys then win out.

Would give nice support to some pretty common conf types, with key fallback.
When I say key fallback, I mean that the INCLUDE_PATH would be walked for
each key (all in one pass), rather than being satisfied with the first file
the is found.  Would work nicely with styles and the like for places with
several levels of fallback.  Without key fallback the entire conf would have
to be duplicated and you end up with duplicated values.

I am more than willing to provide patches, if I could just have a little
help in knowing where to write.  It looks like Template/Directive.pm would
be the place, but I am not sure.

In my short experience with tt, I have only really been displeased with
inability to easily recurse (which may just be a lack of knowledge),
handling conf files, and key fallback on conf files.  This simple addition
would provide for the latter two.

Just looking for feedback.

Thanks,
Earl

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

Reply via email to