This sounds like an XY Problem - why are you so committed to this data structure? Your particular use case is a little unclear from the code you've posted. How do you expect the demo data structure to be stored in the database? Will the elements of the array be joined together into a single string for the field?
my $field = join ',', @{$hashref->{col3}};
Are there multiple fields per key?
$query->execute($hashref->{col1},@{$hashref->{col2}},@{$hashref->{col3 +}});
How exactly do you envision your data being transformed to fit into your database?

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


In reply to Re: access array of values without a loop by kennethk
in thread access array of values without a loop by spie287

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":