* Barrie Slaymaker <[EMAIL PROTECTED]> [2002-12-20 10:08]:
> On Fri, Dec 20, 2002 at 09:54:50AM -0500, darren chamberlain wrote:
> >
> > The docs for Template::Provider state:
> >
> > fetch($name)
>
> fetch()ing's the easy part. Even *I* got that far long ago.
Ah, sorry.
> It's the fact that you can coax metadata out of the template objects
> with AUTOLOADed methods that I didn't see in the docs (not that I've
> seen every bit of the docs, but it didn't leap out at me).
>
> I also have not yet tried to see what happens if you go to fetch
> metadata that a template doesn't happen to declare.
Ah:
$ perl -MTemplate::Provider -wle 'printf qq("%s"\n),
(Template::Provider->new->fetch("foo.tt"))[0]->not_defined'
Use of uninitialized value in printf at -e line 1.
""
With warnings on you get, well, a warning, but then an empty string in
return.
The AUTOLOAD thing is in the docs for Template::Document:
AUTOLOAD
An autoload method returns METADATA items.
print $doc->author()
It's probably unclear, however, that Template::Provider::fetch returns a
Template::Document.
(darren)
--
It's not that things are getting worse, it's just that news reporting
is getting better.