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