Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Variation on the "Higher Order Perl" Iterator Pattern

by Limbic~Region (Chancellor)
on Feb 08, 2008 at 13:54 UTC ( #666967=note: print w/replies, xml ) Need Help??

in reply to Variation on the "Higher Order Perl" Iterator Pattern

You may be interested in Merge Algorithm (Combining Sorted Lists). In it, I provided a more generic (higher order) approach to fetching items from the lists.

You may also be interested in an article I wrote for on Understanding And Using Iterators.

Do you use iterators a lot at work? I once combined 4 different iterators to solve a problem and was wondering if anyone had ever used more. I am rather passionate about iterators because my brain seems to have a hard time thinking recursively.

Cheers - L~R

  • Comment on Re: Variation on the "Higher Order Perl" Iterator Pattern

Replies are listed 'Best First'.
Re^2: Variation on the "Higher Order Perl" Iterator Pattern
by runrig (Abbot) on Feb 08, 2008 at 20:52 UTC
    I wrote RFC: DBIx::Iterator because I needed to join over 20 tables in a database, but the schema was one was quite sure how the tables were supposed to be joined exactly. So I did a lot of experimenting with joining and unjoining tables. In a normal SQL statement though, if you want to remove the table in a join, you have to remove the appropriate SELECT columns, the table in the FROM clause, and the appropriate parts of the WHERE clause. With the iterators I used, I could remove a join by commenting out one line (saving lots of time in the "experimenting" phase). So in a way, it was over 20 iterators joined together (though all the same type).
Re^2: Variation on the "Higher Order Perl" Iterator Pattern
by rjray (Chaplain) on Feb 08, 2008 at 20:01 UTC

    Not a lot, at least not any more than any other given structure. That may change in the future, as we're in the midst of some hard-core refactoring. We have several petabytes of data in MySQL tables, some of which have to be split across physical drives (if not physical machines) due to sheer volume.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2022-06-29 02:50 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (94 votes). Check out past polls.