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

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

  • Comment on Re^5: Put references to array of hash elements in an array

Replies are listed 'Best First'.
Re^6: Put references to array of hash elements in an array
by tel2 (Pilgrim) on Aug 06, 2018 at 04:35 UTC
    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?