package TextStrip; use strict; my $strip_text; use base 'HTML::Parser'; sub text { $strip_text .= $_[1] } my $parser = new TextStrip; my $fh = *DATA; # open $fh onto DATA for demo $parser->parse_file($fh) && print $strip_text; __DATA__ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-12 +52"> <title>Index</title> </head> <body> <h1>Hello World</h1> <p>Just Another <p>Parser Hack </body> </html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strip text from HTML
by briac (Sexton) on Oct 02, 2001 at 04:12 UTC | |
by tachyon (Chancellor) on Oct 02, 2001 at 05:52 UTC |