When you assign to
@ISA, you are removing the reference to CGI::Application. Putting a
print "@ISA\n" after the
use base... line and then after the
@ISA=... line shows the problem:
package Foo;
+
use base 'CGI::Application';
print "@ISA\n";
use Bar;
@ISA = ("Bar");
print "@ISA\n";
# at this point Foo only inherits from Bar
__END__
CGI::Application
Bar
Rather than mixing use of
use base and directly assigning to
@ISA, consider the use of
@ISA alone:
use CGI::Application;
use Bar;
@Foo::ISA = qw(CGI::Application Bar);
BTW, I believe
"bar" should be capitalized in your original code.