Perl | chr() Function Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The chr() function in Perl returns a string representing a character whose Unicode code point is an integer. Syntax: chr(Num)Parameters: Num : It is an unicode integer value whose corresponding character is returned .Returns: a string representing a character whose Unicode code point is an integer. Example 1: Perl #!/usr/bin/perl # Taking some unicode integer value as the parameter # of the chr() function and returning the corresponding # characters as output print chr(71), chr(101), chr(101), chr(107), chr(115); print "\n"; print chr(102), chr(111), chr(114); print "\n"; print chr(71), chr(101), chr(101), chr(107), chr(115); Output: Geeks for Geeks Example 2: Perl #!/usr/bin/perl # Initialising an array of some unicode integer values # and retrieving each value and printing their # corresponding characters my @Array = (71, 101, 101, 107, 115); foreach my $element (@Array) { print chr($element); } Output : Geeks Comment More infoAdvertise with us Next Article Perl | atan2() Function K Kanchan_Ray Follow Improve Article Tags : Perl Perl-function Perl-String-Functions Perl-Inbuilt-Functions Similar Reads Perl | atan2() Function This function is used to calculate arctangent of Y/X in the range -PI to PI. Syntax: atan2(Y, X) Parameters: Y and X which are axis values Returns: Function returns arctangent of Y/X in the range -PI to PI. Example1: Perl #!/usr/bin/perl # Assigning values to X and y $Y = 45; $X = 70; # Calling atan 1 min read Perl | ord() Function The ord() function is an inbuilt function in Perl that returns the ASCII value of the first character of a string. This function takes a character string as a parameter and returns the ASCII value of the first character of this string. Syntax: ord string Parameter: This function accepts a single par 1 min read Perl | ord() Function The ord() function is an inbuilt function in Perl that returns the ASCII value of the first character of a string. This function takes a character string as a parameter and returns the ASCII value of the first character of this string. Syntax: ord string Parameter: This function accepts a single par 1 min read Perl | ord() Function The ord() function is an inbuilt function in Perl that returns the ASCII value of the first character of a string. This function takes a character string as a parameter and returns the ASCII value of the first character of this string. Syntax: ord string Parameter: This function accepts a single par 1 min read Perl | getc Function getc() function in Perl is used to read the next character from the file whose File Handle is passed to it as argument. If no FileHandle is passed then it takes one character as input from the user. Syntax: getc(FileHandle) Parameter: FileHandle: of the file to be read Returns: the character read fr 1 min read Perl | getc Function getc() function in Perl is used to read the next character from the file whose File Handle is passed to it as argument. If no FileHandle is passed then it takes one character as input from the user. Syntax: getc(FileHandle) Parameter: FileHandle: of the file to be read Returns: the character read fr 1 min read Like