Permalink
Browse files

Fix Number::Phone::FR, show brokeness of ::Full

Fix import in Number::Phone::FR.
This reveals that Number::Phone::FR::Full is broken for several
releases.
  • Loading branch information...
1 parent 353bbb3 commit e920a2e04b7c0459bebd4d75db1d21c944e2bd92 @dolmen committed Oct 21, 2011
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/Number/Phone/FR.pm
View
@@ -25,11 +25,9 @@ sub import
croak "invalid sub-class" unless $class->isa(__PACKAGE__);
if ($class eq __PACKAGE__) {
if (@_) {
- foreach my $impl (@_) {
- $class = $impl;
- $class =~ s/^:?(.)/\U$1/;
- substr($class, 0, 0) = __PACKAGE__.'::';
- }
+ $class = $_[0];
+ $class =~ s/^:?(.)/\U$1/;
+ substr($class, 0, 0) = __PACKAGE__.'::';
my $level = 0;
my $pkg;
@@ -39,8 +37,9 @@ sub import
$pkg2impl{$pkg} = $class;
# Load the class
- eval "require $class";
+ eval "require $class; 1" or croak "$@\n";
$class->isa(__PACKAGE__) or croak "$class is not a valid class";
+ print $class->RE_FULL, "\n";
}
} else {
#croak "unexpected arguments for import" if @_;

0 comments on commit e920a2e

Please sign in to comment.