Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Adding to hash that contains an array of arrays

by eppo (Novice)
on Jan 29, 2014 at 20:34 UTC ( #1072577=note: print w/replies, xml ) Need Help??


in reply to Re: Adding to hash that contains an array of arrays
in thread Adding to hash that contains an array of arrays

What i'm trying to do is this, I have an sql table, in the table, there are 2 columns that contain user id's. I'm trying to collect the data for each of the id's. this data was going to be written to an xlsx file. the data needed to create the xlsx file is an array of arrays. so i was thinking about making a hash, that contains each of the id's, and then for each of those id's it points to an array of arrays that I can use to create the spreadsheet. Is there some other way that would be more elegant to get this done?

  • Comment on Re^2: Adding to hash that contains an array of arrays

Replies are listed 'Best First'.
Re^3: Adding to hash that contains an array of arrays
by FloydATC (Deacon) on Jan 30, 2014 at 12:39 UTC

    Where you get the data from is irrelevant, the "push" demonstrated by both moritz and mewsham manipulates your data structure in exactly the way you're asking for.

    It adds an array reference (what an array of arrays really contains) to the array in your hash.

    -- FloydATC

    Time flies when you don't know what you're doing

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2021-10-26 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (91 votes). Check out past polls.

    Notices?