If you want to display some text that may contain html
or html looking elements as part of a webpage, you
can use the HTML::Entities module to easily encode
and decode it for you.
use HTML::Entities;
my $encoded = encode_entities($html);
my $html = decode_entities( $encoded );