Pass your $conf object as a parameter to your TestClass method :
sub anything {
my $self=shift;
my $conf = shift;
# do whatever you want here...
return;
}
And call it this way:
my $conf = new Config;
my $object = new TestClass;
$object->anything($conf);
Another option is to use a singleton, but it may start endless discussions, see what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ? for the gory details :) | [reply] [d/l] [select] |
My English is poor, so I am not able to understand, what do you really want...
You have two modules, both implements method 'new'. So you can create instance of the class everywhere in your code, with no care about ISA or SUPER...
Is your problem that the $conf does not match your criteria and you would rather used the class-parent of the $conf instance? | [reply] |