don't use SelectSaver on IO::Handle->input_*() methods
[p5sagit/p5-mst-13.2.git] / ext / IO / lib / IO / Seekable.pm
CommitLineData
8add82fc 1#
2
3package IO::Seekable;
4
5=head1 NAME
6
7IO::Seekable - supply seek based methods for I/O objects
8
84dc3c4d 9=head1 SYNOPSIS
10
27d4819a 11 use IO::Seekable;
12 package IO::Something;
13 @ISA = qw(IO::Seekable);
84dc3c4d 14
8add82fc 15=head1 DESCRIPTION
16
17C<IO::Seekable> does not have a constuctor of its own as is intended to
18be inherited by other C<IO::Handle> based objects. It provides methods
19which allow seeking of the file descriptors.
20
21If the C functions fgetpos() and fsetpos() are available, then
22C<IO::File::getpos> returns an opaque value that represents the
23current position of the IO::File, and C<IO::File::setpos> uses
24that value to return to a previously visited position.
25
26See L<perlfunc> for complete descriptions of each of the following
27supported C<IO::Seekable> methods, which are just front ends for the
28corresponding built-in functions:
a6006777 29
8add82fc 30 seek
31 tell
32
33=head1 SEE ALSO
34
35L<perlfunc>,
36L<perlop/"I/O Operators">,
27d4819a 37L<IO::Handle>
38L<IO::File>
8add82fc 39
40=head1 HISTORY
41
27d4819a 42Derived from FileHandle.pm by Graham Barr E<lt>bodg@tiuk.ti.comE<gt>
8add82fc 43
8add82fc 44=cut
45
46require 5.000;
47use Carp;
7a4c00b4 48use strict;
8add82fc 49use vars qw($VERSION @EXPORT @ISA);
50use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END);
51require Exporter;
52
53@EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END);
54@ISA = qw(Exporter);
55
7a4c00b4 56$VERSION = "1.06";
8add82fc 57
8add82fc 58sub seek {
59 @_ == 3 or croak 'usage: $fh->seek(POS, WHENCE)';
60 seek($_[0], $_[1], $_[2]);
61}
62
63sub tell {
64 @_ == 1 or croak 'usage: $fh->tell()';
65 tell($_[0]);
66}
67
681;