Re: [template] please help me in template tool kit module

veeru reddy <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <CA+JyuYVqyNiTiWyWufNrMv2c4Pc9=h1z-OG_oYdLEUMoAnQJ7g@mail.gmail.com>
Hi to all,

I need small help in this problem, this the continuation to previous.

[% FOREACH st IN university %]
[% st.name %]
[%st.location%]
studentdata:
[% FOREACH student IN st.branch.electronics.student %]
Component type: [%+ student.name +%][%+ student.number +%]
        [% FOREACH add IN studentaddress.adress %]
       [% IF adress.name==student.name && adress.number ==student.number %]
       [% adress.address %]
 [% END %]
 [% END %]
 [% END %]

by using the script I am comparing values in two keys in a hash and is same
the get the address. I am printing  it workings but my problem is if i have
two or three address for same student, so i placed coma and printing like
this using this line

 [% adress.address %] ,

it printing    address1, address2, address3,   like that but i need to
print like this

if I have three address I need to print like this
 address1, address2 or address3.
if I have two address I need to print like this
 address1, address2.
if I have one address I need to print like this
 address1.

any body can help me in the script what should I have to do to print like
this.

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.