[Templates] [PATCH] lazily load File::Temp

Andy Wardley abw@andywardley.com
Mon, 4 Nov 2002 08:59:12 +0000


Vivek Khera wrote:
> I was really just being pedantic...  but think of a hosting situation
> where the startup is pretty bare, and some Registry program uses the
> template.
[...]
> I personally don't think the preload should be called automagically,
> even if it does the right thing most of the time.

But the new code doesn't make anything worse, it only makes things better.

If you're only using TT via a Registry program then you'll get the same
set of modules loaded when the code does "use Template" instead of 
being trickle loaded as the various different parts are required.

If you're using TT via a non-registry program then you'll get all the 
core modules loaded at startup time in the parent process instead of 
waiting around and loading in the child processes.

So now it'll do the right thing most of the time, and the rest of the 
time, it'll do the no-worse-than-before thing.

A