in reply to how to empty the built_in variable

I suspect you commented out the use strict because you were getting undefined data errors -- in your code $1 is undefined whenever the regexp fails to match.

Functionally it looks like you want two loops rather than one. The outer loop should poll the lines of input and the inner loop should exhaustively parse the line. In addition it is normal and advisable to use one regexp per lexical element in a parser, which changes everything of course, so you might as well use something like XML::Twig instead :)

-M

Free your mind