Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: access array of values without a loop

by kennethk (Abbot)
on Feb 19, 2015 at 12:03 UTC ( [id://1117211]=note: print w/replies, xml ) Need Help??


in reply to access array of values without a loop

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1117211]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-16 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found