Take a look at
HTML::Parser it already does what you want to do. You'll be better off if you don't reinvent this
very complicated wheel.
If you really want to do a parser for academic reason I would recommend at least using
Parse::RecDescent written by
TheDamian this will get you though the tags correctly.
Else you might just be looking for a text based browser like
lynx it will run on *nix and M$ Win
As for your post you can use <code> </code> tags to get you spacing and wrapping correct. I also lets other monks DL your code. There are several resources on Perlmonks that can help you out such as
turnstep's home node.
Enjoy Perlmonks
UPDATE: as
crazyinsomniac pointed out I would be remiss if I did not point out that some searches could have helped out finding some similar nodes like:
parsing HTML
Dump Text from HTML
Search is your friend :)
Some other nodes to read On asking for help and How to ReadTheFineManual
grep
grep> cd pub
grep> more beer |