In most of the cases we deal with text-files and read them sequentially from the beginning to the end, but sometimes we might need some more complex operations on files.

When you open a file for reading, the operating system maintains an internal variable, the current position in the file. Every read starts from this position and every read-operation updates the position.

The seekfunction provided by Perl allows you to move this position without actually reading the content of the file (so without the data transfer from the disk to the memory) and it also allows you to move the position backwards.

The accompanying tell function will always return the index of the current position in the file.