HTML::Escape(3pm)
β¨ HTML::Escape β¨
okay bestie, gather round, because this is <plug> HTML::Escape and it is lowkey one of the fastest little things you will ever meet π
πΈ NAME πΈ
HTML::Escape β extremely fast HTML escaping. that's it. that's the whole vibe. no cap, it just escapes and it does it fast π
π SYNOPSIS π
the whole thing is literally this, bestie:
use HTML::Escape qw/escape_html/;
my $escaped = escape_html("<^o^>");
like... that's it. you import escape_html, you hand it a lil string, it hands you back a safe string. iconic behaviour honestly π
β¨ DESCRIPTION β¨
so this module gives you a function that escapes HTML's special characters π¦ it does basically the same job as PHP's htmlspecialchars. it escapes these characters right here:
" & ' < > ` { }
and the way that it's fast is that it uses XS for better performance π₯ but β and this is the cute part β it also ships a pure perl version too, so if XS isn't your thing you're still covered, bestie π«Ά
π FAQ π
is there also an unescape_html?
No. π
unescaping HTML requires a lot of code, and we don't want to do it. so we simply don't. please use HTML::Entities for it instead β that's what it's there for π
π BENCHMARK π
the receipts β¨:
Rate HTML::Entities HTML::Escape
HTML::Entities 14.0/s -- -91%
HTML::Escape 150/s 975% --
975% faster. i'm not saying a word. i'm just leaving that there. ππ₯
π AUTHOR π
- Goro Fuji
- Tokuhiro Matsuno
<tokuhirom AAJKLFJEF@ GMAIL COM>
π¦ SEE ALSO π¦
Text::XslateHTML::Entities
iykyk π
πΈ LICENSE πΈ
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page babes π₯° go forth and escape responsibly. this has been User Contributed Perl Documentation for HTML::Escape, brought to you by perl v5.42.3 on 2026-08-19 β mwah, slay, periodt π πβ¨
π¦ where this page comes from
- ubuntu stonking: libhtml-escape-perl 1.11-1build7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms