Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

tell

Returns the current byte position in a filehandle.

Returns the current read/write position (in bytes) for the given filehandle, or for the most recently read filehandle when called without arguments. Returns -1 on error or when no filehandle is available.

The returned value is suitable as the POSITION argument to seek.

Synopsis

$pos = tell($fh);    # position in $fh
$pos = tell();       # position in last-read filehandle

See Also

seek, eof, sysseek