The "Statement Handle Attributes" section of the
DBI docs (
perldoc DBI) documents the NAME, NAME_lc, NAME_uc attributes as being read-only array-refs (whereas
$sth->fetchrow_array is documented as returned an array of the values). So you need to assign these values to a scalar and treat it as an array ref:
my $fieldNames = $sth->{NAME_UC};
print join ":", @$fieldNames;