Parsing algebraic expressions is always a pain. If you need to compute, say, 2+4*2, the answer should be the same as (2 + (4 *2)), not ((2 + 4) * 2) — in other words, the right answer is 10, not 12.
It may be that I'm looking at this all wrong. I've got an enormous XML file - 100MB uncompressed text, maybe. I'm bringing it into a similarly enormous hash of arrays of hashes of arrays of (and so ...