From 7031ee9e2b385fd149cd121e3d5d01f99ac99eda Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 10 Jul 2013 16:43:46 -0400 Subject: make this api a bit less dumb --- lib/Exporter/Lexical.pm | 4 +++- t/lib/Foo.pm | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Exporter/Lexical.pm b/lib/Exporter/Lexical.pm index 8eaf1a2..56b0843 100644 --- a/lib/Exporter/Lexical.pm +++ b/lib/Exporter/Lexical.pm @@ -16,6 +16,8 @@ XSLoader::load( sub import { my $package = shift; + my %opts = @_; + my $caller = caller; my $import = sub { @@ -23,7 +25,7 @@ sub import { no strict 'refs'; \%{ $caller . '::' }; }; - my @exports = @{ $caller_stash->{EXPORT} }; + my @exports = @{ $opts{'-exports'} }; my %exports = map { $_ => \&{ $caller_stash->{$_} } } @exports; for my $export (keys %exports) { diff --git a/t/lib/Foo.pm b/t/lib/Foo.pm index 14521ad..48fcd05 100644 --- a/t/lib/Foo.pm +++ b/t/lib/Foo.pm @@ -2,9 +2,7 @@ package Foo; use strict; use warnings; -use Exporter::Lexical; - -our @EXPORT = ('foo'); +use Exporter::Lexical -exports => [ qw(foo) ]; sub foo { "FOO" } -- cgit v1.2.3-54-g00ecf