Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: How to stuff space separated column into Hash

by dirtdog (Monk)
on Aug 29, 2016 at 21:01 UTC ( [id://1170746]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to stuff space separated column into Hash
in thread How to stuff space separated column into Hash

I think I'm all set

while ( my @row = $sth->fetchrow_array() ) { print ">@row<\n"; my %by_month = split ' ', $row[1]; $HoH{$row[0]} = \%by_month;

This accomplishes my objective. Thanks again.

Replies are listed 'Best First'.
Re^4: How to stuff space separated column into Hash
by Marshall (Canon) on Aug 29, 2016 at 21:51 UTC
    Glad that you have something "that works".

    Since I see that you are using the DBI and SQL, I would use the power of SQL instead of trying to replicate this into a HOH. I actually was wondering what you did with for example 'IBM' as element 0. You can get the unique names of the companies, IBM,Oracle, etc. and then run SQL queries to get those company specific results.

    It looks like you may be trying to translate the entire SQL DB into a HoH memory array? I am quite sure that this will work for a spreadsheet. However for a big DB, that won't work and is not necessary.

    It appears to me that you need some more DBI "kung foo".

Log In?
Username:
Password:

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

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

    No recent polls found