M
Matthew Braid
Hi all,
I'm streamlining one of my own packages by splitting off optional
functionality into sub-packages and only use base'ing them when
required, eg:
sub use_something {
my $self = shift;
eval {use base qw/My:
ackage::Something/};
die $@ if $@;
return 1;
}
This works well, but it means that once one instance of the class uses
the 'something', then all of them have it loaded on creation.
I'm not worried about this, but I was wondering if there is a way to
make an instance of an object use an extra base package without the
whole class doing so.
(Oh, and yes I know about AutoSplitting, but its kind of messy and much
harder to write installers for, and results in pretty much the same
thing anyway)
Any ideas? (As I said - not bothered if there is no way
)
MB
I'm streamlining one of my own packages by splitting off optional
functionality into sub-packages and only use base'ing them when
required, eg:
sub use_something {
my $self = shift;
eval {use base qw/My:
die $@ if $@;
return 1;
}
This works well, but it means that once one instance of the class uses
the 'something', then all of them have it loaded on creation.
I'm not worried about this, but I was wondering if there is a way to
make an instance of an object use an extra base package without the
whole class doing so.
(Oh, and yes I know about AutoSplitting, but its kind of messy and much
harder to write installers for, and results in pretty much the same
thing anyway)
Any ideas? (As I said - not bothered if there is no way
MB