Perl Programming/Keywords/sysseek

The sysseek keyword
The sysseek sets the file handle position in bytes by using lseek(2) 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 <tt>POSITION</tt>.

<tt>sysseek</tt> returns the new position on success and <tt>undef</tt> otherwise. For performance reasons, even if the <tt>FILEHANDLE</tt> has been set to operate on characters, the function <tt>tell</tt> will return the byte offsets.

Do not use <tt>sysseek</tt> with reads other than <tt>sysread</tt>, <tt>eof</tt>, <tt>print</tt>, <tt>seek</tt>, <tt>tell</tt>, or <tt>write</tt>, as it bypasses normal buffered I/O.

For <tt>WHENCE</tt>, the constants <tt>SEEK_SET</tt>, <tt>SEEK_CUR</tt>, and <tt>SEEK_END</tt> should be used for portability reasons instead of 0. 1. or 2.