Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: effiecient and modular filtering

by eric256 (Parson)
on May 27, 2004 at 15:47 UTC ( [id://356951] : note . print w/replies, xml ) Need Help??

in reply to Efficient and modular filtering

Instead of having your input filter return the whole set of records have it just return a single record each time. So everytime its called it gets the next record and if its out of records it returns false. Then you could do something like

while ($new = Input::X::read()) { print Output::Y::get_output ($new); } }

Your output filter needs to expect a single record in that case as well.

Eric Hodges

Replies are listed 'Best First'.
Re: Re: effiecient and modular filtering
by roju (Friar) on May 27, 2004 at 16:37 UTC
    I like it. Something similar occured to me over lunch. It seems rather obvious now. Sigh. Thanks :)