On Mon, 21 May 2007 20:05:58 +0400
"Sergey Martynoff" <[EMAIL PROTECTED]> wrote:
>SM >
>SM > > Hi everybody. I think I've found a bug in Template/Base.pm
>SM > > constructor (TT version 2.15). You have to call "map" (line
>SM > > 68) in list context explicitly (from perldoc -f map : "In
>SM > > scalar context, returns the total number of elements so
>SM > > generated"). Patch in attach.
>SM >
>SM > Sorry, compatriot, but that's all right with Template::Base. The "map"
>there
>SM > is already in the list context, because is placed inside hash braces. And,
>SM > anyhow, the whole Template Toolkit won't work, if it would be in scalar
>SM > context ;)
Did you look in Template::Base code? This bug is not critical because BASEARGS
array is empty for all descendants and _init method is called after
constructing $self;
Try this example (it's a little modified part of Template::Base):
========cut========
#!/usr/local/bin/perl -w
use strict;
use Data::Dumper;
my $argnames = [];
my @args = ();
my $hash = {
map { ($_ => shift @args) } @$argnames,
_ERROR => '',
DEBUG => 0,
};
warn Dumper($hash);
========/cut========
with and without braces around map.
>SM >
>SM >
>SM > --
>SM > Sergey Martynoff
>SM >
--
WBR dyker
Agava Software
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates