In comp.lang.perl.misc Dan Jacobson <jidanni (AT) jidanni (DOT) org> wrote:
Quote:
Is my HTML tag stripper up to par?
$ cat striptag
#!/usr/bin/perl -w
#usage example: striptag font div < file.html
read( STDIN, $_, -s STDIN );
foreach my $tag (@ARGV) { s@</?$tag.*?>@@sig }
print; |
As has already been pointed out this will not work for a lot of cases.
Lest anyone should look at this thread hoping for a working one:
#!/usr/bin/perl -w
use strict;
use HTML::Parser;
my $parser = HTML::Parser->new( text_h => [ sub { print shift; },"dtext" ]);
$parser->parse_file(*STDIN);
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent