Skip to content

Instantly share code, notes, and snippets.

@perlDreamer
Created July 6, 2010 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlDreamer/466009 to your computer and use it in GitHub Desktop.
Save perlDreamer/466009 to your computer and use it in GitHub Desktop.
Here's an example (assumes RaiseError is enabled):
my $rows = []; # cache for batches of rows
while( my $row = ( shift(@$rows) || # get row from cache, or reload cache:
shift(@{$rows=$sth->fetchall_arrayref(undef,10_000)||[]}) )
) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment