Seek sets the current location of the file!
When a file is very large, it can be read from a specified location.
Seek filehandle, position, whence
Success returns true, failure returns false.
Position is the new position (in bytes) to read ).
Whence has three values. 0 indicates that the new position is position, 1 indicates that the current position is added with position, and 2 indicates that the position is added at the end of the file.
For example, read and print the 12 bytes of file.txt.
Open (filehandle, "<file.txt") or die "cannot open file.txt ";
Seek filehandle, 12, 0;
While (<filehandle> ){
Print;
}
Close (filehandle );
The Tell function can return the current location of the file handle for a regular file. This location can be used as a parameter to call the seek function, so that it can be moved to a location in the file.
Reference (Click here)