Copyright © tutorialspoint.com

PERL ord Function


Syntax

ord EXPR

ord


Definition and Usage

Returns the ASCII numeric value of the character specified by EXPR, or $_ if omitted. For example, ord('A') returns a value of 65.

Return Value

  • Integer

Example

Try out following example:

#!/usr/bin/perl -w

print("ord() ", ord('G'), "\n");

It will produce following results:

ord() 71

Copyright © tutorialspoint.com