Add tests for IO.pm
[p5sagit/p5-mst-13.2.git] / ext / IO / IO.pm
CommitLineData
8add82fc 1#
2
3package IO;
4
9426adcd 5use XSLoader ();
cf7fe8a2 6use Carp;
7
cf7fe8a2 8$VERSION = "1.20";
9426adcd 9XSLoader::load 'IO', $VERSION;
cf7fe8a2 10
11sub 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
241;
25
26__END__
27
84dc3c4d 28=head1 NAME
29
30IO - 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 39C<IO> provides a simple mechanism to load several of the IO modules
40in 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
51Some other IO modules don't belong to the perl core but can be loaded
52as well if they have been installed from CPAN. You can discover which
53ones exist by searching for "^IO::" on http://search.cpan.org.
84dc3c4d 54
55For more information on any of these modules, please see its respective
56documentation.
57
40a3dda1 58=head1 DEPRECATED
59
60 use IO; # loads all the modules listed below
61
62The loaded modules are IO::Handle, IO::Seekable, IO::File, IO::Pipe,
63IO::Socket, IO::Dir. You should instead explicitly import the IO
64modules you want.
65
84dc3c4d 66=cut
2a0cf753 67