jfroebe has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE: This is what happens when you're out sick for nearly two weeks. Your brain goes to mush. A simple thing: create a Tie::Array subclass. head*desk
I have a bunch of legacy code that requires an array of arrayrefs. Basically:
For relatively small sets of data, this works quite well. However, it throws everything into memory. :( There are hundreds of scripts that rely on this array+arrayref structure so changing the scripts are impractical.
fetchall_arrayref() allows you to retrieve X many rows at a time. I'm thinking of something that behaves like an array but uses an iterator internally. Basically a TIE::Array to an iterator. An intelligent array. Anyone know of anything like that?
157 do { 158 my $tmp_rows = $sth->fetchall_arrayref; 159 push @result_sets, $tmp_rows; 160 } while ( $sth->{syb_more_results} );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tie'ing a dbh result set?
by NetWallah (Canon) on Jul 25, 2011 at 18:30 UTC | |
|
Re: Tie'ing a dbh result set?
by thargas (Deacon) on Jul 25, 2011 at 18:02 UTC | |
by jfroebe (Parson) on Jul 25, 2011 at 19:37 UTC | |
by tye (Sage) on Jul 26, 2011 at 17:12 UTC | |
by jfroebe (Parson) on Jul 26, 2011 at 17:29 UTC | |
by thargas (Deacon) on Jul 26, 2011 at 15:03 UTC |