Je Rog
Je Rog

Reputation: 5993

How to convert special html characters in Perl?

In PHP it's as simple as htmlspecialchars, how to do it in Perl?

Upvotes: 1

Views: 1642

Answers (1)

spraff
spraff

Reputation: 33395

Use the HTML::Entities module.

use HTML::Entities;

my $input = "<em>TEST</em>";
print(encode_entities($input));

Upvotes: 7

Related Questions