isa Foo,Bar; # drops Bar and also spits out warning...
# works same if you quote Bar, dies if Foo
# is quoted or we're under strict
That's because it is using indirect object syntax.
Note that you can say:
which is not so nice as there is no way to explain why "Bar" should be specified differently from "Baz", "Bas" and "Boo". Maybe a more consistent way of specifying multiple inheritance would be:isa Bar qw(Baz Bas Boo);
isa Bar, isa Baz, isa Bas, isa Boo;
main->isa(qw(Foo Bar)); # makes sense... pushes itself onto
# @ISA, though
This can be easily fixed in isa.pm:
-push @{caller().'::ISA'}, @_; +push @{caller().'::ISA'}, map {m#^main$# ? () : $_} @_;
... doesn't seem to be as clean of a solution as it could be.
I agree. I think I'll go back to just setting @ISA myself, and making sure they're run at compile time when I put several packages into one file.
Liz
In reply to Re: Re: package Foo; isa Bar; why not?
by liz
in thread package Foo; isa Bar; why not?
by liz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |