I would do something like:
my $title = shift;
return $title ? [split(/\s+,\s+/, $title)] : [];
}and then in the template:
<%set Eng_Title_loop = title_split($Eng_Title)%>
English Title<%if Eng_Title_loop.length > 1%>s<%endif%>: <%loop Eng_Title_loop%><%if Eng_Title_loop.length > 1 and not first%><%if last%> and <%else%>, <%endif%><%endif%>"<%loop_value%>"<%endloop%>
<%~endif%>
Adrian
Code:
sub { my $title = shift;
return $title ? [split(/\s+,\s+/, $title)] : [];
}
Code:
<%~if Eng_Title%> <%set Eng_Title_loop = title_split($Eng_Title)%>
English Title<%if Eng_Title_loop.length > 1%>s<%endif%>: <%loop Eng_Title_loop%><%if Eng_Title_loop.length > 1 and not first%><%if last%> and <%else%>, <%endif%><%endif%>"<%loop_value%>"<%endloop%>
<%~endif%>
Adrian