Copyright © tutorialspoint.com

PERL getc Function


Syntax

getc FILEHANDLE

getc


Definition and Usage

Reads the next character from FILEHANDLE (or STDIN if none specified), returning the value.

Return Value

  • undef on error or end of file

  • Value of character read from FILEHANDLE

Example

Try following example:

#!/usr/bin/perl

$key = getc(STDIN);
print "Entred value is $key\n";


Copyright © tutorialspoint.com