I guess the error comes from your class MUCParser, possibly in the subroutine num_of_tags, because HTML::Parser works for me independently. But HTML::Parser itself does not store any state, especially not anything like a tag count, so it is mostly interesting what your num_of_tags subroutine does and how/where it stores the tag count. If for example your MUCParser class looks like the following:
package MUCParser; use strict; use base 'HTML::Parser'; use vars '$tag_count'; sub new { my ($class,@args) = @_; ... my $self = $class->SUPER::new(@args); }; sub num_of_tags { return $tag_count; };
then, $tag_count is a global variable and all your MUCParser instances will share that variable. Some more information, like the (stripped down, relevant) source code of MUCParser is needed.
In reply to Re: Parsers overwriting each other
by Corion
in thread Parsers overwriting each other
by bwgoudey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |