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::Xslate
  • HTML::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