Pod::Escapes(3perl)
๐ Pod::Escapes ๐
okay so bestie, welcome to Pod::Escapes, straight outta the Perl Programmers Reference Guide โจ this is the little module that figures out what all those cryptic E<...> sequences in your POD actually mean. it's giving translator energy. it's giving "I speak fluent entity reference". ๐ซถ
๐ธ NAME ๐ธ
Pod::Escapes โ for resolving Pod E<...> sequences ๐
โจ SYNOPSIS โจ
use Pod::Escapes qw(e2char);
...la la la, parsing POD, la la la...
$text = e2char($e_node->label);
unless(defined $text) {
print "Unknown E sequence \"", $e_node->label, "\"!";
}
...else print/interpolate $text...
like. that's it. that's the whole vibe. ๐
๐ฆ DESCRIPTION ๐ฆ
so this module hands you the little tools you need for decoding Pod E<...> sequences. and ngl, it's presumably meant for Pod parsers and/or formatters only โ iykyk, if you're just out here writing POD you probably don't need to touch this directly. ๐
and here's the tea on exports: by default, Pod::Escapes exports none of its symbols. zero. nada. but you can request any of them! either ask for them one at a time, like use Pod::Escapes qw(symbolname symbolname2...);, or go full main-character and do use Pod::Escapes qw(:ALL); to get every exportable symbol in one go. ๐
๐ GOODIES ๐
e2char($e_content)
give it a name or a number that could show up in an E<name_or_num> sequence, and it hands you back the string that thing stands for. ๐
for example: e2char('sol'), e2char('47'), e2char('0x2F'), and e2char('057') all return "/" โ because E<sol>, E<47>, E<0x2f>, and E<057> all mean "/". iconic behavior honestly. ๐
but if the name has no known value (like a name of "qacute") or it's syntactically invalid (like a name of "1/4"), this returns undef. ๐ sorry bestie.
e2charnum($e_content)
same deal, but instead of the string it gives you the number of the Unicode character that it stands for. ๐ข
for example: e2char('sol'), e2char('47'), e2char('0x2F'), and e2char('057') all return 47, because E<sol>, E<47>, E<0x2f>, and E<057> all mean "/", whose Unicode number is 47. โจ
and yeah, same rules as before: if the name has no known value (like a name of "qacute") or is syntactically invalid (like a name of "1/4"), this returns undef. ๐ญ
$Name2character{name}
this hash maps from names (as in E<name>) like "eacute" or "sol" to the string that each one stands for. ๐บ๏ธ
โ ๏ธ important: this does not include numerics (like "64" or "x981c"). and heads up โ under old Perl versions (before 5.7) you get a "?" in place of characters whose Unicode value is over 255. not ideal, but she tries. ๐
$Name2character_number{name}
this one maps from names (as in E<name>) like "eacute" or "sol" to the Unicode value that each one stands for.
for example, $Name2character_number{'eacute'} is 201, and $Name2character_number{'eacute'} is 8364. ๐งฎ
and the slay part: you get the correct Unicode value regardless of the version of Perl you're using โ which differs from %Name2character's behavior under pre-5.7 Perls. so if you're on ancient Perl, this hash is the one that's got your back. ๐ซถ
also noting: this hash does not include numerics (like "64" or "x981c"). ๐
$Latin1Code_to_fallback{integer}
for numbers in the range 160 (0x00A0) to 255 (0x00FF), this maps from the character code for a Latin-1 character (like 233 for lowercase e-acute) to the US-ASCII character that best approximates it (like "e"). ๐
this is chef's kiss useful if you're rendering POD in a format that, in your humble opinion, only really deals well with US-ASCII characters. ๐
$Latin1Char_to_fallback{character}
literally just as above, but this time it maps from characters (like "\xE9", lowercase e-acute) to characters (like "e"). ๐
$Code2USASCII{integer}
this maps from US-ASCII codes (like 32) to the corresponding character (like space, for 32). ๐
heads up though: only characters 32 to 126 are defined. this one is meant for use by e2char($x) when it senses that it's running on a non-ASCII platform (where chr(32) doesn't get you a space โ but $Code2USASCII{32} will). โจ
it's documented here just in case you might find it useful. we're doing it for the plot. ๐
โ ๏ธ CAVEATS โ ๏ธ
okay so the not-so-cute parts, and we're being real about them: ๐ซ
- on Perl versions before 5.7, Unicode characters with a value over 255 (like lambda or emdash) can't be conveyed. this module does work under such early Perl versions, but in the place of each such character, you get a
"?". ๐ Latin-1 characters (characters 160-255) are unaffected though, so at least there's that. ๐ซถ - under EBCDIC platforms,
e2char($n)may not always be the same aschr(e2charnum($n)), and ditto for$Name2character{$name}andchr($Name2character_number{$name})โ because the strings are returned as native, and the numbers are returned as Unicode. different lanes, bestie. however! for Perls starting with v5.8,e2char($n)is the same aschr(utf8::unicode_to_native(e2charnum($n))), and ditto for$Name2character{$name}andchr(utf8::unicode_to_native($Name2character_number{$name})). โจ
๐ SEE ALSO ๐
- Pod::Browser โ a pod web server based on Catalyst. ๐
- Pod::Checker โ check pod documents for syntax errors. ๐
- Pod::Coverage โ check if the documentation for a module is comprehensive. ๐
- perlpod โ description of pod format (for people documenting with pod). โ๏ธ
- perlpodspec โ specification of pod format (for people processing it). ๐
- Text::Unidecode โ ASCII transliteration of Unicode text. ๐ค
๐ฆ REPOSITORY ๐ฆ
<https://github.com/neilbowers/Pod-Escapes> โ go say hi, the source is right there ๐
ยฉ๏ธ COPYRIGHT AND DISCLAIMERS ยฉ๏ธ
Copyright (c) 2001-2004 Sean M. Burke. All rights reserved. ๐ซก
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ๐ช
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. (translation: no promises, bestie. ๐ญ)
Portions of the data tables in this module are derived from the entity declarations in the W3C XHTML specification. ๐
Currently (October 2001), that's these three:
http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
๐ AUTHOR ๐
Sean M. Burke "sburke@cpan.org" ๐
Now being maintained by Neil Bowers <neilb@cpan.org> ๐ซถ
aaaand that's the whole page, bestie!! ๐ this was perl v5.44.0, dated 2026-10-17, and it's Pod::Escapes(3perl) โ now go decode some E<...> sequences, you absolute icon ๐
โจ๐ฆ๐
๐ฆ where this page comes from
- arch rolling: perl 5.44.0-1 ยท Artistic-1.0-Perl AND 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