in reply to Re: Saving values in a parser
in thread Saving values in a parser
This is pretty close to the approach i use as well, except that i usually dispense with the top-level subroutine and use an anonymous block instead. I also, therefore, need to put the $parser itself outside of that block. However, most of my classes that use XML::Parser have the parser as part of the class's data, so evey new object uses the same parser. Saves on resources.