Rodster001 has asked for the wisdom of the Perl Monks concerning the following question:
I was wondering if there is a slightly simpler (fewer lines) to accomplish what I am doing here (maybe without the while loop and/or push).
my $query = qq~ SELECT * FROM my_table ~; my $sth = $dbh->prepare($query); my $rv = $sth->execute; my @res; while (my $r = $sth->fetchrow_hashref) { push(@res, $r); }
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI Array of Hashes... simpler way?
by kennethk (Abbot) on Aug 24, 2009 at 22:06 UTC | |
by ruzam (Curate) on Aug 25, 2009 at 04:09 UTC | |
|
Re: DBI Array of Hashes... simpler way?
by derby (Abbot) on Aug 25, 2009 at 01:47 UTC | |
by Rodster001 (Pilgrim) on Aug 25, 2009 at 17:09 UTC | |
by Anonymous Monk on Jul 16, 2013 at 01:41 UTC | |
|
Re: DBI Array of Hashes... simpler way?
by runrig (Abbot) on Aug 24, 2009 at 22:15 UTC |