I'm working on a template-reading module and I have a question. I'm using a regex to pluck out the references to data and replace them with the data itself, and the template file can be very long. If I were reading straight from the file and interpolating I could use a good ol' while(<>){} loop to keep the segments being regexed short (i.e. to the length of one line). But since I only want to read through the template once and store it in memory, while(<$template>){} doesn't work for obvious reasons.
So I was wondering, is there any good equivalent I can use so that i don't have to slurp the whole file up at once to regex? ~wren __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com