in reply to use NEXT;

It's related to you loading B unintentially. Renaming A, B, C & D to PkgA, PkgB, PkgC & PkgD in the first snippet causes it to output the same thing as the second snippet.

Update: Forgot to mention:

The use of base is discouraged. The usual problem is that it's silent when it fails to load a module (leading to weird error messages). This time, the problem was that it's silent when successfully loading a module (leading to weird behaviour).

Replies are listed 'Best First'.
Re^2: use NEXT;
by Anonymous Monk on Apr 05, 2008 at 21:03 UTC
    <quote>The use of base is discouraged. </quote>

    By whom is it discouraged?

      If you want to have a module that does what base.pm claims, look at my module, parent.pm. It was originally written as a replacement for base.pm, but the Backwards Compatibility Police prevented the outright replacement of base.pm. Hence, parent.pm. I have a (German) talk on the problems of base.pm, which I'll maybe give at the next YAPC::Europe in Copenhagen.

      By the documentation for the module itself, in a forthcoming release. The use of to-be-core parent is encouraged.
        Thank for all!