7 IO::Seekable - supply seek based methods for I/O objects
11 C<IO::Seekable> does not have a constuctor of its own as is intended to
12 be inherited by other C<IO::Handle> based objects. It provides methods
13 which allow seeking of the file descriptors.
15 If the C functions fgetpos() and fsetpos() are available, then
16 C<IO::File::getpos> returns an opaque value that represents the
17 current position of the IO::File, and C<IO::File::setpos> uses
18 that value to return to a previously visited position.
20 See L<perlfunc> for complete descriptions of each of the following
21 supported C<IO::Seekable> methods, which are just front ends for the
22 corresponding built-in functions:
31 L<perlop/"I/O Operators">,
37 Derived from FileHandle.pm by Graham Barr <bodg@tiuk.ti.com>
47 use vars qw($VERSION @EXPORT @ISA);
48 use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END);
51 @EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END);
54 $VERSION = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/);
57 @_ == 1 or croak 'usage: $fh->clearerr()';
58 seek($_[0], 0, SEEK_CUR);
62 @_ == 3 or croak 'usage: $fh->seek(POS, WHENCE)';
63 seek($_[0], $_[1], $_[2]);
67 @_ == 1 or croak 'usage: $fh->tell()';