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