Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

News / Blogs

- Perl Buzz
- Perl Iron Man
- Perlsphere
- Planet Perl
- TPF news
- Use Perl

See also

- CPAN
- Perl.org
- Perl.com
- Perl 5 Wiki
- Perl Jobs
- Perl Mongers
- Perl Monks

Contact

- Site designed and maintained by Jon Allen (JJ)
- http://perl.jonallen.info

- View the project page and FAQs

# tell

Perl 5 version 10.1 documentation
Go to top

# tell

Perl functions A-Z | Perl functions by category | The 'perlfunc' manpage

- tell FILEHANDLE

- tell

  Returns the current position in bytes for FILEHANDLE, or -1 on error. FILEHANDLE may be an expression whose value gives the name of the actual filehandle. If FILEHANDLE is omitted, assumes the file last read.

  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() will return byte offsets, not character offsets (because that would render seek() and tell() rather slow).

  The return value of tell() for the standard streams like the STDIN depends on the operating system: it may return -1 or something else. tell() on pipes, fifos, and sockets usually returns -1.

  There is no `systell` function. Use `sysseek(FH, 0, 1)` for that.

  Do not use tell() (or other buffered I/O operations) on a file handle that has been manipulated by sysread(), syswrite() or sysseek(). Those functions ignore the buffering, while tell() does not.

Recently read

Tools

- Preferences