in reply to Re^2: convert characters
in thread convert characters

Then add 'hi'to your valid entities array
Did you write any of this code yourself?

Update:My addition is not a complete solution by any means, for example it will fail to correctly interpret the following, (organising it so that it does could be a worthwhile exercise for you):

<hi > <a href="http://permonks.org">Link</a> <input value="Next>" type="submit">

Replies are listed 'Best First'.
Re^4: convert characters
by Anonymous Monk on Aug 27, 2009 at 16:26 UTC
    $line =~  s/<(\/?([^>]*?)\/?)>/exists $htmlenties{$2} ? "<$1>" : defined ($1) ? "&lt;$1&gt;" : "&lt;"/xeg; How to just check whether ending tad exists for a tag and if it exists do not replace with &lt; and &gt;.
      You are getting around to writing a complete parser, your original script seemed aimed at not converting specified tags.
      You will need to make a list of opening tags you encounter, and on encountering a closing tag, pop tags off your array converting them unless they match the closing tag.
      On encountering end of file, you will have to pop all remaining tags off and convert them.

      Have a go at writing that yourself and when you hit an issue get back to us.