[Templates] Lists and rand like http://faq.perl.org/perlfaq4.html#How_do_I_select_a_ra

Perrin Harkins perrin@elem.com
Tue, 18 Jul 2006 13:24:20 -0400


On Tue, 2006-07-18 at 18:02 +0100, Gavin Henry wrote:
> What's the proper way ;-)

Picking a random one before running the template and passing it in.
(You did ask...)

However, if you just make a sub that does what you want with the list
ref, you can pass a reference to it to TT in the stash and run it:

[ % my_rand_func(tips) %]

- Perrin