[Templates] Stumped

[prev] [thread] [next] [Date index for 2004/05/18]

From: Harry Jackson
Subject: [Templates] Stumped
Date: 14:29 on 18 May 2004
I am a bit stumped by the following behaviour while using TT and since I 
seem to be getting nowhere fast I thought I would run it past you lot.

I have a few warn statements in my object "_init" methods which are used 
to give an idea where things get to during debugging and I noticed the 
following.

New CMS
CMS CMS->_init()
New CMS::Manager
New CMS::Manager::Session
New CMS::Manager::Session::Pg
New CMS::Manager::Page
New CMS::Page
Died at /var/www/csfp/objects/CMS/Page.pm line 121.


I have deliberately called "die" in the above output just before


     124     $self->template()->process( $lib, $self->page_vars())
     125         or die $self->template()->error(), " Shit\n";

$self->template() returns a template object.

When I take out the "die" call I get the following output.

CMS CMS->_init()
New CMS::Manager
New CMS::Manager::Session
New CMS::Manager::Session::Pg
New CMS::Manager::Page
New CMS::Page
New CMS
CMS CMS->_init()
New CMS::Manager
New CMS::Manager::Session
New CMS::Manager::Session::Pg
New CMS::Manager::Page
New CMS::Page
New CMS
CMS CMS->_init()
New CMS::Manager
New CMS::Manager::Session
New CMS::Manager::Session::Pg
New CMS::Manager::Page
New CMS::Page

I was wondering if anyone has seen this sort of thing before or have an 
explanation for this behaviour. I originally thought it was something to 
do with the perl interpreter not actaully creating the objects until it 
needs them ie some form of COW was going on but it still does not 
explain why I get 2 extra sets. I then thought that maybe TT clones the 
objects somehow but I doubt this is the reason either.

I am pretty sure I have done something silly but you never know hence my 
reason for asking.

H

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Stumped
Harry Jackson 14:29 on 18 May 2004

Re: [Templates] Stumped
Perrin Harkins 18:40 on 18 May 2004

Re: [Templates] Stumped
Harry Jackson 11:48 on 19 May 2004

Re: [Templates] Stumped
Perrin Harkins 16:45 on 19 May 2004

Re: [Templates] Stumped
Harry Jackson 08:58 on 20 May 2004

Re: [Templates] Stumped
Harry Jackson 11:22 on 20 May 2004

Re: [Templates] Stumped
Harry Jackson 12:34 on 20 May 2004

Re: [Templates] Stumped
Andy Wardley 08:19 on 20 May 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52