>>>>> "Matthew" == Matthew Pressly <[EMAIL PROTECTED]> writes:

Matthew> I had originally thought that META would do this, but 
Matthew> it seems to be intended for something different.

You can get at the META vars for a template without actually
running the template like so:

    use Template;
    my $c = Template->new({RELATIVE => 1, ABSOLUTE => 1})->service->context;
    my $d = $c->template("/your/template/path/here"); # Template::Document
    my $one = $d->one; # value of [% META one = "foo" %]

I'm not sure how to get a list of all the meta vars, though, without
peering uncomfortably inside the object, as in:

    my @meta_keys = grep !/^_/, keys %$d;

which is not documented, but gleemed from staring at the source.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

Reply via email to