This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use CLOCK_REALTIME in clock_nanosleep check
[perl5.git] / dist / IO / IO.pm
CommitLineData
8add82fc 1#
2
3package IO;
4
9426adcd 5use XSLoader ();
cf7fe8a2 6use Carp;
b8370f2a
PM
7use strict;
8use warnings;
cf7fe8a2 9
38b4af19 10our $VERSION = "1.37";
9426adcd 11XSLoader::load 'IO', $VERSION;
cf7fe8a2
GS
12
13sub import {
14 shift;
b8370f2a 15
1d94a06f 16 warnings::warnif('deprecated', qq{Parameterless "use IO" deprecated})
b8370f2a
PM
17 if @_ == 0 ;
18
cf7fe8a2
GS
19 my @l = @_ ? @_ : qw(Handle Seekable File Pipe Socket Dir);
20
8901ddee
TC
21 local @INC = @INC;
22 pop @INC if $INC[-1] eq '.';
cf7fe8a2
GS
23 eval join("", map { "require IO::" . (/(\w+)/)[0] . ";\n" } @l)
24 or croak $@;
25}
26
271;
28
29__END__
30
84dc3c4d 31=head1 NAME
32
33IO - load various IO modules
34
35=head1 SYNOPSIS
36
e0d3d5f5
FC
37 use IO qw(Handle File); # loads IO modules, here IO::Handle, IO::File
38 use IO; # DEPRECATED
84dc3c4d 39
40=head1 DESCRIPTION
41
40a3dda1
SP
42C<IO> provides a simple mechanism to load several of the IO modules
43in one go. The IO modules belonging to the core are:
84dc3c4d 44
2a0cf753 45 IO::Handle
46 IO::Seekable
47 IO::File
48 IO::Pipe
49 IO::Socket
cf7fe8a2 50 IO::Dir
40a3dda1
SP
51 IO::Select
52 IO::Poll
53
54Some other IO modules don't belong to the perl core but can be loaded
55as well if they have been installed from CPAN. You can discover which
56ones exist by searching for "^IO::" on http://search.cpan.org.
84dc3c4d 57
58For more information on any of these modules, please see its respective
59documentation.
60
40a3dda1
SP
61=head1 DEPRECATED
62
63 use IO; # loads all the modules listed below
64
65The loaded modules are IO::Handle, IO::Seekable, IO::File, IO::Pipe,
66IO::Socket, IO::Dir. You should instead explicitly import the IO
67modules you want.
68
84dc3c4d 69=cut
2a0cf753 70