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

So we should just take your word for that? Can you give an example? I mean ... I have never had problems with this like you describe. Perhaps you are not using it properly?

Replies are listed 'Best First'.
Re^5: Where is the @ISA array?
by Corion (Patriarch) on Jan 22, 2009 at 13:40 UTC

    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.

      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.

        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'; ... }
Re^5: Where is the @ISA array?
by ikegami (Patriarch) on Jan 22, 2009 at 14:02 UTC
    No, you could search Perl Monks. You could probably find some things on it on the P5P mailing list too. Google sees both.