Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^3: Tie'ing a dbh result set?

by thargas (Deacon)
on Jul 26, 2011 at 15:03 UTC ( #916789=note: print w/replies, xml ) Need Help??

in reply to Re^2: Tie'ing a dbh result set?
in thread Tie'ing a dbh result set?

If you can guarantee that the array will only be accessed:

  • in order
  • read only
  • only once per element
  • you know how many elements there are
then you can do it by simply writing a FETCH which returns the next resultset and a FETCHSIZE which returns the correct size. It would work correctly for usage like:
foreach my $result_ref (@array) { process($result_ref); }

Otherwise, please explain how you make it function as an iterator.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://916789]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2018-06-21 09:38 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.