Subject: | interaction with fields and base |
When you have
use Class::Autouse qw(Apack Bpack);
and these two classes "use fields" and in Bpack there is interitance:
use base qw(Apack);
then you run into a problem since Apack is not loaded by the "use base"
and therefore Bpack misses the fields of Apack.
Unpack the attaches tgz to /tmp and run "ttt" - it works because of
this hack which might become part of Class::Autouse:
BEGIN {
*base::require = sub ($) {
my $mod = shift;
warn "base::require: $mod";
$mod =~ s/\.pmc?$//;
$mod =~ s,/,::,g;
Class::Autouse->load($mod);
};
}
We hijack the "require" in "base" - in principle a clean thing, but
unfortunately the "require Apack" becomes a "Apack.pm" argument in the
sub, so we need to revert the file name to a class name; don't know who
translates the bareword into the string, and how.
What do you think? Offer that on demand with e.g.
use Class::Autouse qw(:base);
???
Cheers,
Marek
Message body not shown because it is not plain text.