This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "[perl #118561] failures loading modules are ignored when sub-package exists"
authorTony Cook <tony@develop-help.com>
Wed, 3 Jul 2013 00:33:52 +0000 (10:33 +1000)
committerTony Cook <tony@develop-help.com>
Wed, 3 Jul 2013 01:06:13 +0000 (11:06 +1000)
This reverts commit c4f21d8bae2372c750ff63b7e5df47996baa1f39.

This broke tests in Moose.

dist/base/lib/base.pm
dist/base/t/base.t

index 446ac16..6b7d39a 100644 (file)
@@ -82,7 +82,7 @@ sub import {
                 # Only ignore "Can't locate" errors from our eval require.
                 # Other fatal errors (syntax etc) must be reported.
                 die if $@ && $@ !~ /^Can't locate .*? at \(eval /;
-                unless (grep { !/::$/ } keys %{"$base\::"}) {
+                unless (%{"$base\::"}) {
                     require Carp;
                     local $" = " ";
                     Carp::croak(<<ERROR);
index 705ed8f..6fb24ea 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test::More tests => 12;
+use Test::More tests => 11;
 
 use_ok('base');
 
@@ -55,11 +55,6 @@ like( $@, qr/^Base class package "reallyReAlLyNotexists" is empty\./,
 eval q{use base 'reallyReAlLyNotexists'};
 like( $@, qr/^Base class package "reallyReAlLyNotexists" is empty\./,
                                           '  still empty on 2nd load');
-eval 'sub reallyReAlLyNotexists::Sub::welp { }';
-eval q{use base 'reallyReAlLyNotexists'};
-like( $@, qr/^Base class package "reallyReAlLyNotexists" is empty\./,
-    '  empty even with sub-package existing');
-
 {
     my $warning;
     local $SIG{__WARN__} = sub { $warning = shift };