in reply to Scalar string to web page
If you want the text to show up verbatim but subject to all of HTML's vagaries (like collapsing whitespace) and render angle brackets as angle brackets, you should proabably entify (entityfy?) the text. Look for HTML entity encoding.
If you want to put the text reasonably formatted, use a module that will at the very least insert <p> or <br> tags as appropriate for line breaks.
If you want to allow some HTML markup, like font tags, breaks, rules, etc., but not all, look at a tag filter or scrubber.
For all of this, keep in mind that if you reasonably expect it to contain utf8 non-ascii characters, you'll want to make sure to let perl know about that by using decode_utf8 or similar function to tag the scalar, so that it doesn't get oddly transcoded (vagueness intentional: I am not an expert on this and it's a very different process from perl 5 to 5.6 to 5.8; your mileage will vary).
|
|---|