in reply to Re: web content parser
in thread web content parser
You can skip the array and just store the words directly into a hash:
# Parse it skipping all but the text my %words; my $parser = HTML::Parser->new( text_h => [ sub { $words{ $_ }++ for split ' ', shift }, 'text' ], default_h => [ '' ], ); $parser->parse( $doc );
|
|---|