Movatterモバイル変換


[0]ホーム

URL:


functions /syswrite
(source,CPAN)
You are viewing the version of this documentation from Perl 5.40.2.View the latest version
#syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET
#syswrite FILEHANDLE,SCALAR,LENGTH
#syswrite FILEHANDLE,SCALAR

Attempts to write LENGTH bytes of data from variable SCALAR to the specified FILEHANDLE, usingwrite(2). If LENGTH is not specified, writes whole SCALAR. It bypasses anyPerlIO layers including buffered IO (but is affected by the presence of the:utf8 layer as described later), so mixing this with reads (other thansysread)),print,write,seek,tell, oreof may cause confusion because the:perlio and:crlf layers usually buffer data. Returns the number of bytes actually written, orundef if there was an error (in this case the errno variable$! is also set). If the LENGTH is greater than the data available in the SCALAR after the OFFSET, only as much data as is available will be written.

An OFFSET may be specified to write the data from some part of the string other than the beginning. A negative OFFSET specifies writing that 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,syswrite will raise an exception. The:encoding(...) layer implicitly introduces the:utf8 layer. Alternately, if the handle is not marked with an encoding but you attempt to write characters with code points over 255, raises an exception. Seebinmode,open, and theopen pragma.

Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.

The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.


[8]ページ先頭

©2009-2026 Movatter.jp