Skip to content

Instantly share code, notes, and snippets.

@kanonji
Created June 7, 2011 09:49
Show Gist options
  • Save kanonji/1011971 to your computer and use it in GitHub Desktop.
Save kanonji/1011971 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.
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;
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;
use strict;
use warnings;
use utf8;
use Foo;
my $result = Foo::invoke();
warn $result;
1;
use strict;
use warnings;
use utf8;
use Foo;
use Bar;
my $result = Foo::invoke();
warn $result;
my $result2 = Bar::invoke();
warn $result2;
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment