This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Check in a stable (working) version before next round of tweaks.
[perl5.git] / lib / PerlIO.pm
1 package PerlIO;
2
3 # Map layer name to package that defines it
4 my %alias = (encoding => 'Encode');
5
6 sub import
7 {
8  my $class = shift;
9  while (@_)
10   {
11    my $layer = shift;
12    if (exists $alias{$layer})
13     {
14      $layer = $alias{$layer}
15     }
16    else
17     {
18      $layer = "${class}::$layer";
19     }
20    eval "require $layer";
21    warn $@ if $@;
22   }
23 }
24
25 1;
26 __END__