$parser->handler( start => \&start_handler, 'tagname, self' ); $parser->parse( $content ); sub start_handler { return if shift ne 'li'; my $self = shift; $self->handler( start => \&title_handler, 'tagname, attr, self' ); } sub title_handler { my( $tagname, $attr, $self ) = @_; return if $tagname ne 'a'; return unless $attr->{title}; my $text; $self->handler( text => sub{ $text = shift; }, 'dtext' ); say "$text: $attr->{href}"; # Use of uninitialized value $text in concatenation (.) or string }