Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by thargas (Chaplain)
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.


Comment on Re^3: Tie'ing a dbh result set?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://916789]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-08-28 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls