chr(NUMBER);
ord(CHARACTER);
Perl's
chr() and
ord() functions are used to convert characters into their ASCII or Unicode values (and vice versa).
chr() takes an ASCII or Unicode value and returns the equivalent character, and
ord() performs the reverse operation by converting a character to it's ASCII or Unicode value.
print chr(65);
print "\n";
print ord('A');
print "\n";
For more information on encoding, try some of these links:
- About ASCII
- ASCII Character Code Reference
- Perl Encoding with the Encode Module