Tutorials Point


  Perl Home

  PERL Functions

© 2011 TutorialsPoint.COM


  Home     References     About TP     Advertising  

PERL sysread Function



Syntax

sysread FILEHANDLE, SCALAR, LENGTH, OFFSET

sysread FILEHANDLE, SCALAR, LENGTH


Definition and Usage

Tries to read LENGTH bytes from FILEHANDLE, placing the result in SCALAR. If OFFSET is specified, then data is written to SCALAR from OFFSET bytes, effectively appending the information from a specific point. If OFFSET is negative, it starts from the number of bytes specified counted backward from the end of the string. This is the equivalent of the C/operating system function read( ). Because it bypasses the buffering system employed by functions like print, read, and seek, it should only be used with the corresponding syswrite and sysseek functions.

Return Value

  • undef on error

  • 0 at end of file

  • Integer, number of bytes read



Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names