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>
In reply to Strip text from HTML by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |