in reply to difference between "use base" and @ISA?

What about:

BEGIN { require 'Foo'; @ISA = ('Foo'); }

Does that work? base does its @ISA munging at compile-time, so CGI::Application::Plugin::AutoRunmode may be dependent on that.

Replies are listed 'Best First'.
Re^2: difference between "use base" and @ISA?
by CountZero (Bishop) on Aug 25, 2005 at 16:00 UTC
    @ISA = ('Foo'); will destroy whatever was already in @ISA and will surely break a lot of other things depending on that array.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      My understanding has always been that @ISA is a package global, so the only way it would have something in it is if it were set elsewhere in the same package, which would be a pretty strange thing to do. In other words, it's safe to overwrite it in your own package. I think friedo's code is fine, but I'd be happy to learn otherwise if there's something I'm missing.