| Input and output functionsFixed-length unbuffered output to a filehandleDaftar Isi - syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET
- syswrite FILEHANDLE,SCALAR,LENGTH
- syswrite FILEHANDLE,SCALAR
Attempts to write LENGTH bytes of data from variable SCALAR to thespecified FILEHANDLE, using write(2). If LENGTH isnot specified, writes whole SCALAR. It bypasses buffered IO, somixing this with reads (other than sysread()) , print , write ,seek , tell , or eof may cause confusion because the perlio andstdio layers usually buffer data. Returns the number of bytesactually written, or undef if there was an error (in this case theerrno variable $! is also set). If the LENGTH is greater than thedata available in the SCALAR after the OFFSET, only as much data as isavailable will be written. An OFFSET may be specified to write the data from some part of thestring other than the beginning. A negative OFFSET specifies writingthat many characters counting backwards from the end of the string.If SCALAR is of length zero, you can only use an OFFSET of 0. WARNING: If the filehandle is marked :utf8 , Unicode charactersencoded in UTF-8 are written instead of bytes, and the LENGTH, OFFSET, andreturn value of syswrite() are in (UTF8-encoded Unicode) characters.The :encoding(...) layer implicitly introduces the :utf8 layer.Alternately, if the handle is not marked with an encoding but youattempt to write characters with code points over 255, raises an exception.See binmode, open, and the open pragma, open. |
| |
|