Pod::Escapes(3p)

Pod::Escapes3p

For resolving pod e<...> sequences

Usage

  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...

Overview

This module provides things that are useful in decoding Pod E<...> sequences. Presumably, it should be used only by Pod parsers and/or formatters.

By default, Pod::Escapes exports none of its symbols. But you can request any of them to be exported. Either request them individually, as with "use Pod::Escapes qw(symbolname symbolname2...);", or you can do "use Pod::Escapes qw(:ALL);" to get all exportable symbols.

Goodies

e2char($e_content)

Given a name or number that could appear in a "E<name_or_num>" sequence, this returns the string that it 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 "/". If the name has no known value (as with a name of "qacute") or is syntactically invalid (as with a name of "1/4"), this returns undef.

e2charnum($e_content)

Given a name or number that could appear in a "E<name_or_num>" sequence, this returns the number of the Unicode character that this 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. If the name has no known value (as with a name of "qacute") or is syntactically invalid (as with a name of "1/4"), this returns undef.

$Name2character{name}

Maps from names (as in "E<name>") like "eacute" or "sol" to the string that each stands for. Note that this does not include numerics (like "64" or "x981c"). Under old Perl versions (before 5.7) you get a "?" in place of characters whose Unicode value is over 255.

$Name2character_number{name}

Maps from names (as in "E<name>") like "eacute" or "sol" to the Unicode value that each stands for. For example, $Name2character_number{'eacute'} is 201, and $Name2character_number{'eacute'} is 8364. 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.

Note that 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 aproximates it (like "e"). You may find this useful if you are rendering POD in a format that you think deals well only with US-ASCII characters.

$Latin1Char_to_fallback{character}

Just as above, but 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). Only characters 32 to 126 are defined. This 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.

Caveats

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.

Under EBCDIC platforms, e2char($n) may not always be the same as "chr(e2charnum($n))", and ditto for $Name2character{$name} and chr($Name2character_number{$name}), because the strings are returned as native, and the numbers are returned as Unicode. However, for Perls starting with v5.8, e2char($n) is the same as "chr(utf8::unicode_to_native(e2charnum($n)))", and ditto for $Name2character{$name} and "chr(utf8::unicode_to_native($Name2character_number{$name}))".

Repository

<https://github.com/neilbowers/Pod-Escapes>

Releases

32 releases since OpenBSD 5.0; the text changed 20 times.

  1. 5.0–5.3
  2. 5.4–5.5
  3. 5.6
  4. 5.7
  5. 5.8–5.9
  6. 6.0
  7. 6.1
  8. 6.2
  9. 6.3–6.4
  10. 6.5
  11. 6.6
  12. 6.7
  13. 6.8
  14. 6.9–7.2
  15. 7.3
  16. 7.4
  17. 7.5
  18. 7.6
  19. 7.7–7.8
  20. 7.9
  21. 8.0

Author

Sean M. Burke "[email protected]"

Now being maintained by Neil Bowers <[email protected]>

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's man source.