in reply to Re^2: Multi-Dimensional Array to Hash Conversion Optimization
in thread Multi-Dimensional Array to Hash Conversion Optimization

*smacks head*
not everyone upgrades as rapidly as you do, boo...
If you can, hie thee unto cpan:
Changes in DBI 1.15, 28th March 2001 ... Added selectall_hashref thanks to Leon Brocard. ...
  • Comment on (boo) Re:x3 Multi-Dimensional Array to Hash Conversion Optimization
  • Download Code

Replies are listed 'Best First'.
Re^4: Multi-Dimensional Array to Hash Conversion Optimization
by tadman (Prior) on Apr 03, 2001 at 21:00 UTC
    You're quick on the upgrades, apparently. Nicely.

    The only downside is that selectall_hashref returns a ref to an array of hashes, not a hash of hashes based on a particular key field. Close, but not quite! Still, it has applications.

    Thanks for the tip!
      really? I wish I had time to play with it right now...
      If I understand you correctly, you can the same functionality, that is, an array of hashes, from
      my $result_ref = $l_sth->fetchall_arrayref({})
      You can then do things like $$result_ref[0]{field} the above two lines are from code running on production machine; I know it works because my pager is too quiet for it to be otherwise.
      But for 1.15's fetchall_hashref, I haven't looked yet. Must play later.