Keep It Simple, Stupid | |
PerlMonks |
Re: Tag filtering: a standard mechanism?by tachyon (Chancellor) |
on Sep 13, 2001 at 07:08 UTC ( [id://112091]=note: print w/replies, xml ) | Need Help?? |
Should I just use HTML::Parser and shut up? Yes!Here is a filter example to get you going - its really quite easy once you get you head around how it works. I find the pod a little obscure but there are some good tutorials out there. You should easily see how we check each opening and closing tag and add it if it is on the ok list - parser calls &start for opening tags and &end for closing tags. Similarly we add the text between the OK opening and closing tags as parser calls &text and we have flagged that we do or don't want this text. If you just want the text just don't add the tags. What could be easier?
cheers tachyon s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In Section
Seekers of Perl Wisdom
|
|