in reply to Zaurus addressbook.xml parser
I think you're going through way too much effort for a breakable parser. XML::LibXML or XML::Twig make proper parsing for simple stuff no more difficult than a bit of regex twiddling is, and will also handle complex cases. If you post a representative snippet of your input I can whip up some libxml code that won't be longer than half your script. And much easier to read.
Makeshifts last the longest.
In Section
Cool Uses for Perl