in reply to •Re: Juggling structures with Template Toolkit
in thread Juggling structures with Template Toolkit

Okay, that makes sense. Thank you.

that's bordering on a little too much processing in TT code

How would you go about doing that processing within the script then? I did try something along the lines of the following snippet and it failed horribly. Perhaps I'm just a little off?

$TMPL->process('something.tmpl', { myopts => [ map { {value => $_} } qw(one two three) ] } ); __END__ [% PROCESS "another.tmpl" options => myopts %]

Replies are listed 'Best First'.
Re: Re^2: Juggling structures with Template Toolkit
by perrin (Chancellor) on Apr 02, 2004 at 22:08 UTC
    That works perfectly for me, except that it looks like you should have assigned that array to "options" instead of "myopts" or maybe both.
Re^3: Juggling structures with Template Toolkit
by Anonymous Monk on Apr 02, 2004 at 22:08 UTC

    update: I will now admit that I am officially dumbed out for the day. The script method with the map works fine. I don't know what happened earlier. Perhaps I forgot to double up the curly braces around the map. Thanks to merlyn for showing a TT way of doing it anyhow :)

      I asked a similar question on the TT mailing list back in December of 2003. extremely responded "... maybe you should just fix it in Perl rather than trying get TT to be a full language with all the amenities." Indeed, TT is candy store and we are kids. :)

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)