How to Pass an Array to a Template

Hello List,

I am trying to pass an array to a template, but I cannot figure out how
to make it work.

With this line I pass the arguments.
( $ret, $msg ) = $internalMail_template->Parse(Ticket => $TicketObj,
User => $utente, Services => @list_services);

While I don’t know what to do within the template, in order to get the
values of @list_services.
What I need to do is print the values of Services in the template one
after the other on a new line.

Thanks for any help or suggestion.

Simone Sanna

You need to pass the array as a reference. Google: perl array references

-ToddOn Dec 17, 2010, at 11:35 AM, Simone Sanna simone.sanna@tinet.net wrote:

Hello List,

I am trying to pass an array to a template, but I cannot figure out how to make it work.

With this line I pass the arguments.
( $ret, $msg ) = $internalMail_template->Parse(Ticket => $TicketObj, User => $utente, Services => @list_services);

While I don’t know what to do within the template, in order to get the values of @list_services.
What I need to do is print the values of Services in the template one after the other on a new line.

Thanks for any help or suggestion.

Simone Sanna


List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel