Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Perl Programming/Keywords/seek

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Perl scalar seekdir Keywords The seek keyword The seek sets the file handle position as fseek of UNIX. The FILEHANDLE can also an expression that evaluates to the filehandle. WHENCE can have the values 0 to set the POSITION in bytes, 1 so that it is set to the current position plus POSITION, and 2 to set it to EOF plus POSITION. seek returns 1 on success and false otherwise. For performance reasons, even if the FILEHANDLE has been set to operate on characters, the function tell() will return the byte offsets. For WHENCE, the constants SEEK_SET, SEEK_CUR, and SEEK_END should be used for portability reasons instead of 0, 1, or 2. Do not use seek with sysread or syswrite, as buffering makes the file's read-write position unpredictable and non-portable, but use sysseek instead. Syntax seek FILEHANDLE, POSITION, WHENCE Examples seek(TEST, 0, 1); See also sysread sysseek syswrite tell Perl scalar seekdir Keywords