The handlers aren't being called as methods on your instance. Instead perhaps you should pass an anonymous coderef which turns the callback into a method call?
my $p = XML::Parser->new( Handlers => { Start => sub { $self->handle_start( @_ ) }, Default => sub { $self->handle_char( @_ ) }, }, );
Additionally: be aware that defining subs nested inside of subs doesn't create lexically scoped subs; they're still members of the package in which they're declared, and in fact doing things this way can lead to strange warning messages (the infamous "variable will not stay shared" seen often in mod_perl circles; see "my () Scoped Variable in Nested Subroutines" for an explanation).
In reply to Re: Objects, callbacks and XML::Parser
by Fletch
in thread Objects, callbacks and XML::Parser
by ixl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |