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 );
In reply to Re^2: web content parser
by jwkrahn
in thread web content parser
by stan131
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |