Not true... If your platform uses a character set other
than ASCII, chr and ord may behave differently:
On these platforms, bear in mind that the EBCDIC character set may have an effect on what happens with some perl functions (such as chr, pack, print, printf, ord, sort, sprintf, unpack), as well as
bit-fiddling with ASCII constants using operators like ^, & and |, not to mention dealing with socket interfaces to ASCII computers (see NEWLINES).
Lifted from perlport. Also see the following quote
from the same document:
Assume very little about character sets. Do not assume anything about the numerical values (ord(), chr()) of characters. Do not assume that the alphabetic characters are encoded contiguously (in
numerical sense). Do no assume anything about the ordering of the characters. The lowercase letters may come before or after the uppercase letters, the lowercase and uppercase may be interlaced
so that both 'a' and 'A' come before the 'b', the accented and other international characters may be interlaced so that ä comes before the 'b'.
| [reply] |