Tutorials Point


  Perl Home

  PERL Functions

© 2011 TutorialsPoint.COM


  Home     References     About TP     Advertising  

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";



Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names