tell 
tell FILEHANDLE
tellThis function returns the current file position (in bytes,
zero-based) for FILEHANDLE. Typically, this
value will be fed to the seek
function at some future time to get back to the current position.
FILEHANDLE may be an expression giving the
name of the actual filehandle or a reference to a filehandle object. If
FILEHANDLE is omitted, the function returns
the position of the file last read. File positions are meaningful only
on regular files. Devices, pipes, and sockets have no file
position.
Note the in bytes: even if the filehandle has
been set to operate on characters (for example, by using the :encoding(utf8) open layer), tell still always returns byte offsets, not
character offsets (because that would render seek and tell rather slow).
There is no systell function.
Use sysseek(FH, 0, 1) for that. Seek
seek for an example telling how to
use tell.
Do not use tell (or other
buffered I/O operations) on a filehandle that has been manipulated by
sysread, syswrite, or sysseek. Those functions ignore the buffering,
while tell does not.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access