Perl syswrite Function

Advertisements


Description

This function attempts to write LENGTH bytes from SCALAR to the file associated with FILEHANDLE. If OFFSET is specified, then information is read from OFFSET bytes in the supplied SCALAR. This function uses the C/operating system write( ) function, which bypasses the normal buffering.

Syntax

Following is the simple syntax for this function:

syswrite FILEHANDLE, SCALAR, LENGTH, OFFSET

syswrite FILEHANDLE, SCALAR, LENGTH

Return Value

This function returns undef on error and Integer, number of bytes written on success.

Example

Following is the example code showing its basic usage:


When above code is executed, it produced following result




Advertisements
Advertisements