— |
use 5.006001;
no warnings 'redefine' ;
our $VERSION = '0.15' ;
sub import {
my $package = caller ;
*{ "${package}::$_" } = sub { return wantarray ? @_ : $_ [0] }
for qw(a an teh the more) ;
my ( $class , $module ) = @_ ;
if ( $module ) {
eval "require $module" ;
die $@ if $@;
splice @_ , 0, 1;
my $import = $module ->can( 'import' )
or return ;
goto &$import ;
}
}
sub unimport {
my $package = caller ;
*{ "${package}::$_" } = sub { return wantarray ? @_ : $_ [0] }
for qw(a an teh the more) ;
my ( $class , $module ) = @_ ;
if ( $module ) {
eval "require $module" ;
die $@ if $@;
splice @_ , 0, 1;
my $unimport = $module ->can( 'unimport' )
or return ;
goto &$unimport ;
}
}
*{ "a::" } =
*{ "an::" } =
*{ "more::" } =
*{ "teh::" } =
*{ "the::" };
1;
|