[Petal] Creating template from string

Michael Graham magog at the-wire.com
Thu Jul 21 19:33:05 BST 2005


> One thought though - how will Petal cache the complied version of a
> template created from a string? Perhaps some sort of 'cache key' could
> be passed to the constructor?

That's a good question.  I initially tried making a Petal subclass that
didn't need a filename, but I got foiled by all the file caching stuff.

Since we can make strings look like filehandles, would a filehandle work
just as well?

As for a cache key, maybe you could use "SCALAR(0x813cd9c)" or whatever
the stringified version of the scalarref's address is?  It would mean
that to change the template you'd have to pass in a new string, not just
change the existing buffer.


Michael


--
Michael Graham <magog at the-wire.com>




More information about the Petal mailing list