Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: how to force HTML to display as text

by grep (Monsignor)
on Jan 24, 2002 at 12:38 UTC ( #141174=note: print w/replies, xml ) Need Help??

in reply to how to force HTML to display as text

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> cd pub
    grep> more beer
    • Comment on Re: how to force HTML to display as text
  • Log In?

    What's my password?
    Create A New User
    Domain Nodelet?
    Node Status?
    node history
    Node Type: note [id://141174]
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (None)
      As of 2022-01-26 06:19 GMT
      Find Nodes?
        Voting Booth?
        In 2022, my preferred method to securely store passwords is:

        Results (69 votes). Check out past polls.