Your array contains a single element: the string abc,xyz,123,test
. If you want each of those things to be separate elements, you need to create your array differently:
@count = ('abc', 'xyz', 123, 'test');
@count = qw(abc xyz 123 test);
Update: OK, after reading the docs for <TMPL_LOOP>
, it looks like you actually want an arrayref of hashrefs:
$count = [
{ name => '???', value => 'abc' },
{ name => '???', value => 'xyz' },
{ name => '???', value => '123' },
{ name => '???', value => 'test' },
];
$template->param(COUNT => $count);
$template->param(COUNT => [{...}, {...}, {...}, ...]); # same thing
However, I can’t tell from your question which one should be the label and which one should be the value, so I’ll leave that as an exercise for you to complete.
8
solved why in perl array value is not listing on dropdown list using html template?