Commit | Line | Data |
---|---|---|
8add82fc | 1 | # |
2 | ||
3 | package IO; | |
4 | ||
9426adcd | 5 | use XSLoader (); |
cf7fe8a2 | 6 | use Carp; |
b8370f2a PM |
7 | use strict; |
8 | use warnings; | |
cf7fe8a2 | 9 | |
38b4af19 | 10 | our $VERSION = "1.37"; |
9426adcd | 11 | XSLoader::load 'IO', $VERSION; |
cf7fe8a2 GS |
12 | |
13 | sub 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 | ||
27 | 1; | |
28 | ||
29 | __END__ | |
30 | ||
84dc3c4d | 31 | =head1 NAME |
32 | ||
33 | IO - 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 |
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: | |
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 | ||
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. | |
84dc3c4d | 57 | |
58 | For more information on any of these modules, please see its respective | |
59 | documentation. | |
60 | ||
40a3dda1 SP |
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 | ||
84dc3c4d | 69 | =cut |
2a0cf753 | 70 |