in reply to Re^5: DBI hashref does not return data in order of query
in thread DBI hashref does not return data in order of query

It was a misunderstanding on my part. Here is my whole function, and I get an error about coercing an array into a hash.
my @names = @{ $sth->{NAME} }; my @ordered_values = (); my %xml_hash = ( dataset => [] ); while ( my $row = $sth->fetchrow_arrayref ) { @ordered_values = @{$row}{@names}; <----Can't coerce array in +to hash HERE } my $cgi = CGI->new; print $cgi->header('text/xml'); my $testxml = XMLout( \@ordered_values, NoAttr => 1, RootName => ' +dataset', ); print $testxml;