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

I think you want to look into DBI's ->bind_col and ->bind_columns instead of these hacks.

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

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

Replies are listed 'Best First'.
Re^4: Put references to array of hash elements in an array
by tel2 (Pilgrim) on Aug 03, 2018 at 10:42 UTC
    I didn't know they were hacks, Rolf, but thanks for the tips.
      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?