in reply to Re^2: mro's which to use for flexibility?
in thread mro's which to use for flexibility?
Your code is highly confused, or at least does not highlight where the problem you describe is.
BEGIN{unshift @ISA,"TorClient";} our $mp = Data::Vars->new(); P "main::ISA=%s", \@ISA; $mp->trm_open('trm', 'localhost:1024');
The altering of @ISA only alters @main::ISA, but the class you're dealing with is of type Data::Vars, whose inheritance you have not altered at all.
I suggest you learn about namespaces and importing subroutines instead of trying to solve problems by abusing inheritance.
What prevents you from writing a class My::TorClient, which defines all the methods you want?
Update: Also see Aggregation, which points to Object composition, and Moose::Manual::Roles. But I think in the end you will be much better served by writing simple subroutines that call the functions you want to call.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: mro's which to use for flexibility?
by perl-diddler (Chaplain) on Feb 07, 2016 at 11:56 UTC |