Recursion is the way I'd solve something like this. Start processing the data, line by line, and when you hit a 'begin template' ({{), recursively process it.
An example of a nested template and a sample of what you are trying to generate might make it easier to be specific about the solution -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/