in reply to Re: Text highlighting (not language syntax)
in thread Text highlighting (not language syntax)

Thanks, I am starting from text. I tested and got
Undefined subroutine &main::escaped_entities called at test_highlight. +pl line 24.

Replies are listed 'Best First'.
Re^3: Text highlighting (not language syntax)
by ikegami (Patriarch) on Jan 22, 2010 at 23:09 UTC
    Should have been encode_entities, and it's available from HTML::Entities. See my updated code.
      Still a problem
      Bareword found where operator expected at test_highlight.pl line 21, n +ear ""<b>" . encode_entities("$2") . "</b" (Might be a runaway multi-line // string starting on line 13) (Missing operator before b?) Scalar found where operator expected at test_highlight.pl line 22, nea +r ": encode_entities("$3" (Might be a runaway multi-line "" string starting on line 21) (Missing operator before $3?) String found where operator expected at test_highlight.pl line 28, nea +r "print text_to_html("" (Might be a runaway multi-line "" string starting on line 22) (Missing semicolon on previous line?) Bareword found where operator expected at test_highlight.pl line 28, n +ear "print text_to_html("best" (Do you need to predeclare print?) syntax error at test_highlight.pl line 21, near ""<b>" . encode_entiti +es("$2") . "</b" Can't find string terminator '"' anywhere before EOF at test_highlight +.pl line 28.
      Got it, should be
      "<\/b>"