> 1. Don't see a clean way to do the usual prepare(), while(fetch())
> looping you'd normally do with DBI; Inline::SQL functions will always
> return all of the results (potentially very large sets).
How about using a callback function - all function prototypes could have an
implict 'callback' parameter and could be used like so:
get_users(\&callback);
get_users("callback");
get_users( sub{print join(",", @{$_[0]}), "\n"} );
sub callback {
my $aref = shift;
print join(",", @$aref), "\n";
}
The return value of the callback function could be used to signal that no
more records are required:
$max = 10;
$count = 0;
sub callback {
my $aref = shift;
print join(",", @$aref), "\n";
if (++$count < $max) {
return 1;
} else {
return undef;
}
}
--
Simon Olievr