swiftone has asked for the wisdom of the Perl Monks concerning the following question:
Every intro article and related code I've seen using these modules uses them to translate between formats. So far so good, but now I need to understand positional information. (For example, in XML::Parser, I have a series of <elementX> <date>Text</date><amount>Amount</amount></elementX> sets. I need to recognize what tagset text is inside of, and then associate that data with the order of the outer tags. (i.e. I want to end up with something like [{date=>'Text', amount =>'Amount'}, {date=>'Text2',amount=>'Amount2'}...]
The simple parsers I have to examine use global variables. The documentation seems to imply there are more advanced methods of dealing with this, but they all assume more parser experience than I have.
What am I missing? Is there some way to pass objects into my parse handlers, or make those handlers part of an object?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Saving values in a parser
by tadman (Prior) on Jul 11, 2001 at 20:27 UTC | |
by AidanLee (Chaplain) on Jul 11, 2001 at 20:46 UTC |