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