Re: [Templates] how to see error messages

[prev] [thread] [next] [Date index for 2005/04/13]

From: Andy Wardley
Subject: Re: [Templates] how to see error messages
Date: 07:24 on 13 Apr 2005
Dave Howorth wrote:
> my $tt = Template->new();

Try this:
  my $tt = Template->new( DEBUG => 'undef' );   # yes, the string "u n d e f"

> test.tt
> -------
> [% USE Test = Class('MyTest') ;
>    Test.method() ;
>    'success'
> %]

With the DEBUG flag set as shown, undefined values are thrown as exceptions:

  "undef error - method is undefined"

TT treats all data types as equal (more or less).  foo.bar returns 
the 'bar' part of 'foo', or undef if it doesn't exist (including a 
'bar' method missing from a 'foo' object).  And by default, TT ignores 
any undefined values unless you set the DEBUG => undef flag.

I admit it's not entirely obvious or helpful in cases like this, but that's 
the way it is I'm afraid.  It may get better in v3...

A


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

[Templates] how to see error messages
Dave Howorth 12:36 on 11 Apr 2005

Re: [Templates] how to see error messages
merlyn (Randal L. Schwartz) 14:45 on 11 Apr 2005

Re: [Templates] how to see error messages
merlyn (Randal L. Schwartz) 14:51 on 11 Apr 2005

Re: [Templates] how to see error messages
Dave Howorth 15:09 on 12 Apr 2005

Re: [Templates] how to see error messages
Andy Wardley 07:24 on 13 Apr 2005

Re: [Templates] how to see error messages
Dave Howorth 09:36 on 13 Apr 2005

Re: [Templates] how to see error messages
Dave Howorth 10:23 on 14 Apr 2005

Generated at 09:31 on 27 Apr 2005 by mariachi v0.52