-
-
Save tokuhirom/1013957 to your computer and use it in GitHub Desktop.
perl ./once.pl is ok. perl ./twice.pl is not ok. Use 0.20110401 of Number::Phone::JP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Number/Phone/JP/Table.pm b/lib/Number/Phone/JP/Table.pm | |
index ddca7c4..9e26380 100644 | |
--- a/lib/Number/Phone/JP/Table.pm | |
+++ b/lib/Number/Phone/JP/Table.pm | |
@@ -5,7 +5,6 @@ use warnings; | |
use base qw(Exporter); | |
our $VERSION = '0.20110401'; | |
-our @EXPORT = qw(%TEL_TABLE); | |
require Number::Phone::JP::Table::Class1; | |
require Number::Phone::JP::Table::Class2; | |
@@ -35,6 +34,13 @@ our %TEL_TABLE = ( | |
%Number::Phone::JP::Table::Fmc::TEL_TABLE, | |
); | |
+sub import { | |
+ my $class = shift; | |
+ my $pkg = caller(0); | |
+ no strict 'refs'; | |
+ %{"$pkg\::TEL_TABLE"} = %TEL_TABLE; | |
+} | |
+ | |
1; | |
__END__ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use utf8; | |
use Test::More tests => 1; | |
{ | |
package Foo; | |
use Number::Phone::JP; | |
use Number::Phone::JP; | |
sub invoke { | |
my ( $self ) = @_; | |
my $ins = Number::Phone::JP->new; | |
my $result = $ins->set_number('03-5321-1111')->is_valid_number; | |
return $result; | |
} | |
} | |
is(Foo::invoke(), 1); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment