< Perl Programming < Keywords
![](../../../I/Crystal_Clear_action_apply.png.webp)
The lines
The ord keyword
ord returns the number associated with the EXPRESSION. If EXPRESSION is an empty string, the function returns 0. Without NUMBER, the contents of $_ are used.
ord is the reverse of chr.
Syntax
ord EXPRESSION
ord
Examples
![](../../../I/Crystal_Clear_action_apply.png.webp)
#!"C:/Programms/Perl/site/bin"
use 5.10.0;
$character = 'A';
say "character = '" . $character, "' corresponds to the value of " . ord $character;
returns
number = 65 corresponds to the code 'A' character = 'A' corresponds to the value of 65
See also
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.