-
-
Save tokuhirom/1013957 to your computer and use it in GitHub Desktop.
Revisions
-
tokuhirom revised this gist
Jun 8, 2011 . 6 changed files with 49 additions and 60 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ 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); 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +0,0 @@ -
kanonji created this gist
Jun 7, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ package Bar; use strict; use warnings; use utf8; 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; warn scalar keys %Number::Phone::JP::TEL_TABLE; return $result; } 1; 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ package Foo; use strict; use warnings; use utf8; 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; warn scalar keys %Number::Phone::JP::TEL_TABLE; return $result; } 1; 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ use strict; use warnings; use utf8; use Foo; my $result = Foo::invoke(); warn $result; 1; 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ use strict; use warnings; use utf8; use Foo; use Bar; my $result = Foo::invoke(); warn $result; my $result2 = Bar::invoke(); warn $result2; 1;