The problem is probably that XML::Parser is an
object factory: it generates XML::Parser::Expat
objects with each parse or parsefile
call. The handlers then receive XML::Parser::Expat
objects and not XML::Parser objects.

There is a way to store data in the XML::Parser
object and to access it in the handlers though:
use the 'Non-Expat-Options' argument when creating
the XML::Parser: