in reply to Get a hash object from a database with DBI for use with HTML::Template
Warning: this reads the entire data set into memory, so be careful not to read huge amounts of data.
You can avoid this by creating other problems :)
Inside of get_hash(),
dug
You can avoid this by creating other problems :)
Inside of get_hash(),
can becomemy $sth = $dbhandle->prepare( $stmt );
This will block other processes, and you will need to roll throught the complete dataset with fetchall_* or fetchrow_* and friends to avoid future errors on the handle unless you want to set up a brand new database for each query. It does seem to make sense some places, however.my $sth = $dbhandle->prepare( $stmt, {"mysql_use_result" => 1} );
dug
In Section
Cool Uses for Perl