--- name: seek status: documented runtime: pp source: src/runtime/pp/io.rs --- ```{index} single: seek; Perl built-in (pp runtime) ``` # seek ## Synopsis ```perl seek($fh, $offset, 0); # SEEK_SET — absolute position seek($fh, $offset, 1); # SEEK_CUR — relative to current seek($fh, $offset, 2); # SEEK_END — relative to end ``` ## Description Sets the read/write position in a filehandle. Repositions the file pointer for the given filehandle. The WHENCE argument selects the reference point: 0 (SEEK_SET) for the beginning of the file, 1 (SEEK_CUR) for the current position, and 2 (SEEK_END) for the end of the file. Returns 1 on success, 0 on failure. Also accepts IO::Handle / IO::File objects (blessed hashrefs with `__fh_id`). ## See also tell, sysseek, Fcntl