[Templates] [].merge([1,2],[3,4]) ?

Paul Seamons mail@seamons.com
Mon, 23 Jul 2007 13:30:56 -0600


> I just tried this and thought it might be nice if it worked
> in some future version of TT.  I wouldn't be surprised if it
> already does ..?
>
> $ tpage.bsb
> [% [].merge([1,2],[3,4]) %]

I believe it is planned to.  It currently works in Template::Alloy which means 
it should work with Template::Parser::CET as well.

Paul

paul@paul-laptop:~/perl/CGI-Ex$ perl -e '
use Template::Alloy;
Template::Alloy->new->process(\q{
[% DUMP [].merge([1,2],[3,4]) %]
})'

DUMP: File "input text" line 1
    [].merge([1,2],[3,4]) = [
          '1',
          '2',
          '3',
          '4'
        ];