I finally got this to work just the way I wanted. I checked the result to see if it was an array ref, then formed a sub-table if it was:
#massage multi-values for formatting
if ( ref $encodedvalue eq 'ARRAY' )
{
my $listtable .= $cgi->start_table({-border=>0});
for ( my $i=0; $i<scalar( @$encodedvalue) ; $i++ )
{
$listtable .= $cgi->Tr({},
$cgi->th(@$encodedvalue[$i])
);
}
$listtable .= $cgi->end_table();
$data .= Tr({},
$cgi->td({-class=>'label'},
$attrHash->{ATTRNAME}),
$cgi->td({-class=>'value'},
($listtable || $cgi->p(' '))));
}
else {
$data .= Tr({},
$cgi->td({-class=>'label'},
$attrHash->{ATTRNAME}),
$cgi->td({-class=>'value'},
($encodedvalue || $cgi->p(' '))));
}}
|