in reply to Re^4: Where is the @ISA array?
in thread Where is the @ISA array?

From base.pm:

die if $@ && $@ !~ /^Can't locate .*? at \(eval /;

So you won't ever hear of a file that couldn't be found, instead you get a useless message about the base class being empty:

Carp::croak(<<ERROR); Base class package "$base" is empty. (Perhaps you need to 'use' the module which defines that package f +irst.) ERROR

... and that only if the namespace wasn't ever touched before. The following code will not fail nor warn despite the file Foo/Bar.pm not existing:

use strict; BEGIN { print "Foo::Bar::VERSION : $Foo::Bar::VERSION\n"; }; package Foo::Baz; use base 'Foo::Bar'; package main; print "done\n.";

... because base.pm does not look in %INC to see whether a module was loaded.

Replies are listed 'Best First'.
Re^6: Where is the @ISA array?
by Anonymous Monk on Jan 22, 2009 at 13:48 UTC
    That's a petty and trivial reason to not use base, no? And if it is such a problem for everyone ... how did that get out the production door? Why has there not been a "bug" fix?

      Because Schwern (who added all those misfeatures) threw his hands up in despair and declared it unfixable. Hence, the fixed version was released under a new name, parent.pm.

      And it's not a problem when things work, but once things fail, they fail ways that are hard to debug because whether a subclass gets loaded depends on program flow in a nonobvious way.

        I guess I just know how to use base then. *shrug* You guys are really doing a great job of tearing Perl up, module by module.

      That's a petty and trivial reason to not use base, no?

      Considering there's no reason to use base in the first place...

      Why has there not been a "bug" fix?

      They did fix it with the creation of parent. Fixing it in place would break the following intended use of base:

      { package Base; ... } { package Subclass; use base 'Base'; ... }
        So the fix is to go back to all of our code and replace base with parent and retest and try to explain to our clients why they have to pay for it. That's just great. No, really. Thanks a lot.

        I guess the answer is use Moose! I'm never using base again. Nor parent.