Skip to content
Browse files

use Sub::Exporter and no default export

  • Loading branch information...
1 parent c21b654 commit 1e9ea90c5007cdcb63ffbfb1d165ba00cf346177 @renormalist committed Jul 15, 2011
Showing with 7 additions and 7 deletions.
  1. +3 −0 Makefile.PL
  2. +3 −6 lib/Scalar/Util/reftype/Inline.pm
  3. +1 −1 t/basic.t
View
3 Makefile.PL
@@ -2,4 +2,7 @@ use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Scalar::Util::reftype::Inline',
+ PREREQ_PM => {
+ 'Sub::Exporter' => '0',
+ },
);
View
9 lib/Scalar/Util/reftype/Inline.pm
@@ -10,12 +10,9 @@ XSLoader::load(__PACKAGE__);
sub reftype { die 42 }
-sub import {
- $^H{ __PACKAGE__ . '/reftype' } = 1;
- my $caller = caller;
- no strict 'refs';
- *{ join q{::} => $caller, 'reftype' } = \&reftype;
-}
+use Sub::Exporter -setup => {
+ exports => [qw(reftype)],
+};
sub unimport {
$^H{ __PACKAGE__ . '/reftype' } = 0;
View
2 t/basic.t
@@ -2,7 +2,7 @@ use strict;
use warnings;
use Test::More;
-use Scalar::Util::reftype::Inline;
+use Scalar::Util::reftype::Inline "reftype";
use Scalar::Util ();

0 comments on commit 1e9ea90

Please sign in to comment.
Something went wrong with that request. Please try again.