Name

syswrite

Synopsis

syswrite filehandle, scalar, length, [offset]

Description

Writes length bytes of data from variable scalar to the specified filehandle. The function returns the number of bytes actually written, or the undefined value on error. You should be prepared to handle the problems that standard I/O normally handles for you, such as partial writes. The offset, if specified, says where in the string to start writing from, in case you’re using the string as a buffer, for instance, or you need to recover from a partial write.

Do not mix calls to print (or write) and syswrite on the same filehandle unless you really know what you’re doing.

Get Perl in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.