IO.pm 1.4 KB

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