The value of whence specifies which of three file positions your offset is relative to: 0, the beginning of the file; 1, the current position in the file; or 2, the end of the file. offset may be negative for a whence of 1 or 2.
seekdir
seekdir dirhandle, pos Set the current position for the readdir routine on dirhandle. pos must be a value returned by telldir. This function has the same caveats about possible directory compaction as the corresponding system library routine.
at work also
seekdir
seekdir dirhandle, pos
Set the current position for the readdir routine on dirhandle. pos must be a value returned by telldir. This function has the same caveats about possible directory compaction as the corresponding system library routine.
from perl in a nutshell