Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: Put references to array of hash elements in an array

by tel2 (Pilgrim)
on Aug 03, 2018 at 10:42 UTC ( [id://1219794]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Put references to array of hash elements in an array
in thread Put references to array of hash elements in an array

I didn't know they were hacks, Rolf, but thanks for the tips.
  • Comment on Re^4: Put references to array of hash elements in an array

Replies are listed 'Best First'.
Re^5: Put references to array of hash elements in an array
by LanX (Saint) on Aug 03, 2018 at 14:36 UTC
    It's a "hack" because you really need special reasons to assign to a list of references, that is rarely needed and complicated.

    It looks like you are updating a full record of ages from SQL.

    I'd suggest to look into DBI->fetchall_hashref() and even considering changing your data structure to ->fetchall_hashref("name") (or whatever your primary key is)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Thanks Rolf.

      I've started using your bind_col() suggestion, which seems to be working just like a bought one, thank you again!  I hadn't looked a the DBI documentation for a long time (and even then probably just at what I wanted at the time) and didn't realise many of these options even existed.

      Re the full record of ages, yes it looks strange, but that's just my simplified example for posting this question.

      5 scalps and that's my 3rd-to-last offer?

Log In?
Username:
Password:

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

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

    No recent polls found