Maybe Andy or someone else can chime in, but i think it's something that can't be done. Your method will have to test if the first non-self argument is an array ref before assuming you can slurp @_ for your arguments. Not the best of trade-offs, I know.

Peter Kay wrote:

What if I had an array of things [% Array = [ 'Green',
'Blue', 'Pink' ] %], and I wanted to pass them to a
function as arguments - akin to:
[% Object.UseColours( 'Green', 'Blue', 'Pink' ) %]

I can't do
[% Object.UseColours( Array ) %]
because then UseColours() will get only one argument -
a reference to an array.

I'm not terribly interested in performace - this isn't
for a webpage that's getting 50,000,000 hits a day ;-)
And these aren't going to be large data structures -
certainly less than the size of the scalars that are
going to hold return values of HTML...

--Peter





_______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to