On Mon, Sep 29, 2008 at 2:12 AM, Sönke Barkow <[EMAIL PROTECTED]> wrote:

> Hello @ll!
> I'm not sure if this mailing list is the used way to"announce" problems
> like this one, but .....
>
> I've got a problem with the debugging system of TT2:
> I often need to use more complex data structures like arrays of hashes
> of hashes containing arrays or whatever.
> So I use interpolated variables to access a single element like this:
>
> [% array.key2.$bla.0 %]
>
> $bla might be a value fetched from a database and could be undefined or
> an empty string or anything less useful.
> In this case the debugger seems to crash! With activated debugging I get
> no output from this template anymore.
> Is debugging deactivated, everything works like expected ... there is
> just no return value and I get an empty form field (or where ever this
> value ist used, it's just empty).
>
> I don't want to go without debugging, so what could I do!?  Is this a
> bug? ... or what's my fault?
>

An actual template and actual input data that cause the problem to manifest
would be immensely valuable.  Without those, your problem is really too
vague to be addressed.  Certainly there are no general issues with using an
empty string as a hash key in a template.  This program prints "it works"
for me:

use Template;
use strict;

my %vars = (
  bla => "",
  array => { key2 => { "" => [ "it works" ] } }
);

my $t = Template->new;
$t->process(\*DATA, \%vars);

__DATA__
[% array.key2.$bla.0 %]
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to